All Perl variables that begin with digits, control
characters, or punctuation characters are exempt from the
effects of the package declaration and are always forced
to be in package main. A few other names are also exempt:
ENV STDIN
INC STDOUT
ARGV STDERR
ARGVOUT
SIG
so adding
you getprint "\$main::ENV = '$main::ENV'\n";
as expected...$main::ENV = '2'
In reply to Re: Scalar $ENV in a package
by cianoz
in thread Scalar $ENV in a package
by knight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |