> I knew all of this, however since I didn't declare the include file to
> contain a package I assumed that all variables would be brought into the
> main:: namespace.
> Why is this not the case?

It is the case. Variables in the required file are in the main:: namespace.

However, variables declared with my do not reside in the main::
namespace. They are lexically scoped variables, and their namespace is
the one belonging to the innermost block enclosing the my declaration;
in this case, presumably the file scope of the main script file.
Declaring with our would put them into main::.


Jason Elbaum
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl

Reply via email to