note
shotgunefx
A clarification on the following point.<br>
<i>
The closest thing to a global variable in perl is a variable that lives in main::'s symbol table. This is because whenever a variable is referred it is always looked for in main::. But this is only a last resort,
</i><br><br>
This is not true. If you are not in main:: it will not look in main for a variable unless you use <b>our $var</b> and then it's still only I belive in the current lexical scope.
<code>
# Prints nothing.
perl -e '$var = 'value';package FOO; print $var'
#prints "value"
perl -e 'our $var = 'value';package FOO; print $var'
#prints "value"
perl -e '$var = 'value';package FOO; print $main::var'
</code>
<br><br>
-Lee
<br><br>
"To be civilized is to deny one's nature."
149304
149325