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"; } }
In reply to Is this BEGIN construct supposed to work? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |