Yes, the localization for the variable doesn't happen until the end of the statement, so the value on the right is the previous value (plus one), and it's undone at the end of the block.sub my_sub { local $my_sub_level = $my_sub_level + 1; .. }
-- Randal L. Schwartz, Perl hacker
In reply to •Re: sub and anonymous sub
by merlyn
in thread sub and anonymous sub
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |