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"; }
In reply to Re^2: chomp not working in array
by diotalevi
in thread chomp not working in array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |