in reply to Truncate string
sub cut { my ($str, $n) = @_; ($str =~ /^(?=.{$n})(.{0,@{[$n-1]}})\s(.*)$/s, $str, '')[0,1]; } [download]