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";