in reply to Re^4: Finding a LCS module on word level
in thread Finding a LCS module on word level

Good point. Leaving aside issues of "What constitutes a word", this process seems like it would boil down to:
sub lcs { my ($string, $find) = @_; $string = join ' ', split ' ', $string; my @f = split ' ', $find; my ($starting_point, $max_length, $substr) = (0,0, ''); foreach my $start ( 0 .. $#f - 1 ) { foreach my $len ( 1 .. $#f - $start - 1 ) { my $search = join ' ', @f[$start .. $start + $len ]; if ( $string =~ $search ) { if ( $len > $max_length ) { $max_length = $len; $start_point = $start; $substr = $search; } } } } return $search; }

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?