in reply to 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"; } [download]
This will not work. As others pointed out, chomp does not chomp white spaces.
Your reverse() trick will work ;-) if chomp chomps trailing white spaces.