Because that mangles @array1 - $_ is aliased to each element from @array1 and the substitution clobbers the original value
In reply to Re^3: array with s///g command
by GrandFather
in thread array with s///g command
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |