in reply to reversing substr

If you're looking for something truncate the string, then you might want to look into the pack function. It has the added advantage of right-padding the string with blanks:
use strict; my $str = "1234"; my $ss = pack "A2", $str; print "'$ss'\n"; ### example shows example of padding blanks $ss = pack "A5", $str; print "'$ss'\n";
Produces:
'12' '1234 '

--Jim