Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Note how the BEGIN treats %hash as if it were a file-scoped global. The keys that are set in %hash are still set when routine() starts and are retained between calls to routine().sub routine { my %hash; BEGIN { $hash{KEY} = "string"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Is this BEGIN construct supposed to work?
by JavaFan (Canon) on Nov 02, 2011 at 22:21 UTC | |
Re: Is this BEGIN construct supposed to work?
by ikegami (Patriarch) on Nov 02, 2011 at 23:47 UTC | |
Re: Is this BEGIN construct supposed to work? (does not)
by tye (Sage) on Nov 02, 2011 at 22:21 UTC |
Back to
Seekers of Perl Wisdom