Bennett Haselton wrote:
> The documentation for "use vars" says: "Unlike pragmas that
> affect the $^H hints variable, the use vars and use subs
> declarations are not BLOCK-scoped. They are thus effective
> for the entire file in which they appear."
Note that it makes no statements about other files -- only about the file in
which the "use vars" pragma appears.
> Does that contradict the documentation's claim that "use
> vars qw($x);" should only take effect within the test3.pm
> file -- since "$x" appears in test.pl with no predeclaration?
No, since the documentation does not claim that "use vars" only takes effect
inside the file. (At least, the bit you quoted does not.)
Remember, "use" is like a require within a BEGIN block and is executed at
compile time. So when you "use test3" ahead of using $x in test.pl, Perl has
already seen the "use vars" declaration for $x.
Cheers,
Philip
--
Philip Newton <[EMAIL PROTECTED]>
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users