use Tree::Suffix; my $string = 'The cat jumped over the dog. Smart cat! He jumped over the dog. ' . 'The cat jumped over the dog.'; my $tree = Tree::Suffix->new($string); print "$_\n" for $tree->lrs;