in reply to Re: array with s///g command
in thread array with s///g command

That will update @array1. OP implied that @array2 should have the updated strings. Of course it may be that OP intended the two arrays to actually represent the contents of an unspecified array at two different time, in which case:

s/\s+//g for @fields;

may be what OP is looking for.

I find it a little tricky to read some OP's minds at times. ;)


DWIM is Perl's answer to Gödel