in reply to Truncating after the last period

( my $new_string = substr $string, 0, 400 ) =~ s/[^.]*\z//;