What does really happen here?
The source file for module 'Mod' is searched, read and compiled at run time, as opposed to use, which would lead to compilation of the module at compile time of the script which contains that 'use' statement.
Nothing special about scoping here. The namespace of the module 'Mod' is defined after successful compilation, and it has its own scope. The visibility of that namespace is not confined to the block which contains the 'require', it is available to all perl code executed thereafter, no matter if it's in the same scope or even the same file.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: 'require/use' scoping
by shmem
in thread 'require/use' scoping
by gnum.prul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |