in reply to How to delete trailing spaces from array elements?

s/\s+$// for (@arr1);
- Miller

Replies are listed 'Best First'.
Re^2: How to delete trailing spaces from array elements?
by bart (Canon) on Jul 31, 2007 at 11:10 UTC
    s/\s+$// for (@arr1);
    With a for loop in modifier mode, you don't need the parens. The code gets just a little bit tidier that way (IMO of course).
    s/\s+$// for @arr1;