Personally I prefer this formulation (with the same caveat about modifying the global):
sub ChangeArray1 { $_ = 1 for @A; }
which to me is both clear and concise. All subjective, of course.
And for the benefit of the OP: Go To Statement Considered Harmful.
In reply to Re^2: Changing an array from a sub
by hippo
in thread Changing an array from a sub
by harangzsolt33
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |