in reply to How to substitute the elements in an array without changing the original array.
or even@new = map { ... } @{[ @original ]};
If legibility (management overhead due to fussy boss) is a concern, I then choose to use an idomatic version of the for / do { ... } for loop.@new = grep { local $_ = $_; ... } @original;
or if you want multiple expressions within the loop..... for @new = @original;
do { ...; ... } for @new = @original;
|
|---|