sub lcs { my ($string, $find) = @_; my $l = length $find; while ( $l > 0 ) { my $pos = index( $string, $find ); if ( $pos > -1 ) { return ( $pos, $l ); } $l--; chop $find; } return; }