use Text::Stripper qw(stripof); my $text1 = q{Lorem ipsum dolor sit amet, consectetur, adipisci velit}; my $text2 = q{This is a new sentence which should be stripped at a point.}; my $len = 30; my $tol = 10; my $max = 1; my $dots = 1; print stripof( $text1, $len, $tol, $max, $dots ), "\n"; print stripof( $text2, $len, $tol, $max, $dots ), "\n";
Lorem ipsum dolor sit amet, consectetur... This is a new sentence which should be...