What would you expect to happen here?
BEGIN { my $x = 'foo'; }
Outside of the block, would you expect to see a variable named $x? Would you expect it to have a value?
In fact, it doesn't, because the normal lexical scoping rules apply. BEGIN isn't extra special magic in that variables leak out. It's just a normal block that happens to execute at a special time.
In reply to Re: Re: BEGIN initialization and memory
by chromatic
in thread BEGIN initialization and memory
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |