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