local only works on global variables.Not true. It's not even true if you meant "package" where you wrote "global".
$ perl -wE 'my @a = (1, 2, 3); {local $a[1] = 7; say "@a";} say "@a"' 1 7 3 1 2 3
In reply to Re^4: Are global variables "bad"?
by JavaFan
in thread Are global variables "bad"?
by jpearl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |