in reply to Re^3: Are global variables "bad"?
in thread Are global variables "bad"?
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
|
|---|