my $field = 'big long string...'; $field = substr($field,0,255); # or a regex (slower of course) $field =~ s/^(.{255}).*$/$1/;