note
Sinister
It seems you are completely correct. I was under the distinct assumption that defining a variable in a scope (aka declaring) trough the use of <code>our</code>, lifted that variable out of the scope and accesible for other scopes. This seems only trough when using <code>no strict 'vars'</code> (but that would not be nice).
<br><br>
<off-topic><br>
Does it matter whetter we call 'this' defining or declaring? I know the difference between the two, and if you are a nice <code>perl -wT && strict</code> programmer you define and declare all at once, to prevent warnings.
<br></off-topic><br>
<br>
Your snippet leads to the suspicion that more evil-hack's are possible with perl, then I so far realized.<br>
I off course tested your snippet, and it works prima!<br>
However if you would add these lines:<br>
<code>
package not_main;
{
print $foo;
print $main::foo;
print "\n";
}
package main;
</code>
It would _still_ work fine. This puzzles me. (Why one would define more packages inside one script puzzles me as well)<br><br>
As you I was somewhat confinced that I knew the language and the behavior of the interpreter by now. This has once again proofed me wrong, and <b>that is what keeps perl interesting!</b><br><br>
And then, last but not least: thnx 4 ur reply ;-)
<br><br>
<B><A HREF="/index.pl?node=Sinister">A righthanded-lefthand...</A></b>.<br>
<font size="2"><i>"Field experience is something you don't
get until just after you need it."</i></font><br>
149304
149595