local() variables, on the other hand, are visible to routines that are called from the block where they are declared.
Not quite. It doesn't make the variables visible outside the block.
sub foo { ??? how do you access the var ??? } { my %hash; local $hash{foo} = 123; foo(); }
It doesn't even create variables as your wording suggests. It's not that what you said is wrong, just unclear and/or misleading. (Compare to what I used earlier.)
In reply to Re^2: Difference b/w my and local var?
by ikegami
in thread Difference b/w my and local var?
by anbutechie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |