in reply to Re: chomp not working in array
in thread chomp not working in array
Let me elaborate on pg's note. Not only will chomp not do what you hoped, using reverse is needlessly expensive. This is better written using two efficient s/// expressions.
for ( @phrase ) { s/^\s+//; s/\s+$//; print "$_\n"; }
|
|---|