use strict; use warnings; use Algorithm::Diff qw/ LCS_length /; ( my $name = $ARGV[0] ) && length $ARGV[0] > 2 or die "Usage: `$0 ` (min. 3 letters)"; open my $fh, '<', '/usr/share/dict/words' or die $!; my $found = 0; while ( <$fh> ) { next unless LCS_length( [ split //, $name ], [ split // ] ) == length $name; $found++; print "$found $_"; } __END__