in reply to Re^2: Are global variables "bad"?
in thread Are global variables "bad"?

local only works on global variables. It puts a temporary value into the global variable until the current block is left. Also see Seven Useful Uses for Local.

Replies are listed 'Best First'.
Re^4: Are global variables "bad"?
by JavaFan (Canon) on Apr 21, 2009 at 21:21 UTC
    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