http://www.perlmonks.org?node_id=948266


in reply to How do I remove whitespace at the beginning or end of my string?

my $string = q{ this is a string }; $string = reverse unpack('A*',reverse(unpack 'A*',$string)); print "<$string>\n";