in reply to Re: 'use' inside or outside of package declaration?
in thread 'use' inside or outside of package declaration?
Firstly if you use a modlue that exports symbols into the caller's namespace, then those symbols will only visable in the package that used the module.Eh, no.
Global symbols, whether exported or not, are just that. Global. Visible from everywhere. Sure, if you import something in package A, then switch to package B, you may need to use a fully qualified name, but both the exported and imported name are visible.
Believing that the package statement should come first is equivalent of saying no meaningful code can be written that has more than one package statement in a file.use File::Copy; package Foo; ::copy($from, $to); # Not a problem.
CPAN begs to differ.
|
|---|