The use keyword automatically imports the names from modules. When a module is defined in the current file in the lexical scope (please note that the module can be declared as local with my module), no import will be done by default. In this case, importing the names should be done explicitly with the import keyword.
my module M { Â Â Â sub f($x) is export { Â Â Â Â Â Â Â return $x; Â Â Â } }Â import M;Â say f(42);
The f name will only be available for use after it is imported. Again, only the names marked as is export are exported.
As import happens in the compile-time, the import instruction itself can be located even after some names from the module are used.
my module M { Â Â Â sub f($x) is export { Â Â Â Â Â Â Â return $x; Â Â Â } }Â say f(1); # 1 import M; say f(2); # 2