headybrew has asked for the wisdom of the Perl Monks concerning the following question:
Hello my monkitudinous friends,
Why is it that when I do:
next, why does:
"my" variable $main::FOO can't be in a package at ./footest.pl line...
But if I use:
And, no, the lines are not in any sub blocks or anything. They're the only lines in the test script.
Just doin' my best to waste my time and yours...
-heady
Why is it that when I do:
I don't see "FOO" in the output? Shouldn't 'my' put it in the main:: symbol table?my $FOO; print join("\n",sort(keys(%main::)) );
next, why does:
do this:my $main::FOO; print join("\n",sort(keys(%main::)) );
"my" variable $main::FOO can't be in a package at ./footest.pl line...
But if I use:
it works?local $FOO; print join("\n",sort(keys(%main::)) );
And, no, the lines are not in any sub blocks or anything. They're the only lines in the test script.
Just doin' my best to waste my time and yours...
-heady
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Ask a Silly Question...
by Util (Priest) on Feb 01, 2008 at 03:05 UTC | |
Re: Ask a Silly Question...
by Fletch (Bishop) on Feb 01, 2008 at 02:35 UTC | |
Re: Ask a Silly Question...
by ikegami (Patriarch) on Feb 01, 2008 at 04:05 UTC | |
Re: Ask a Silly Question...
by roboticus (Chancellor) on Feb 01, 2008 at 14:26 UTC |
Back to
Seekers of Perl Wisdom