in reply to Finding a LCS module on word level

Here's a quick and dirty solution
use String::LCSS_XS qw( lcss ); sub lcssw { my ($s1, $s2) = @_; my $i; my %codes; my %words; for ($s1, $s2) { $_ = join '', map { $codes{$_} = chr(++$i) if !exists($codes{$_}); $codes{$_} } lc($_) =~ /\w+/g; } my $lcss = lcss($s1, $s2); @words{values %codes} = keys %codes; return join ' ', @words{ $lcss =~ /./sg }; }

Untested. Shouldn't be used if the two input strings combined contain more than 254 different words. (The technique can be extended through clever encoding of the number, but you'd be better spending your efforts modifying the module to handle words.)

Update: Fixed typo ($lcss_ ⇒ $lcss)