As has been mentioned lexicals at a file scope aren't accessible outside that file. What you've written is (more or less) equivalent to trying to do this:
{ my $var1 = "hello"; my $var2 = "perl!"; } print $var1; print $var2;
If you tried to do that under strict you'd get errors immediately because you're trying to access variables after they've gone out of scope. See Coping with Scoping.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: accessing values
by Fletch
in thread accessing values
by frank1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |