You can find some additional enlightenment in Dominus' Coping with Scoping, but to get the same effect with a my-declared variable, you can just redeclare it in a different scope (ie, inside a { ... }).
perl -lwe "my $var='qq';{my $var=2;print $var;}print $var"
--k.
In reply to Re: Can't localize lexical variable $var at...
by Kanji
in thread Can't localize lexical variable $var at...
by Courage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |