#!/usr/bin/perl use strict; print "Enter word to be solved.\n"; print "Use a dash (-) to indicate a single missing letter.\n"; print "Use a star (*) to match 0 or more letters.\n"; print "Use a plus (+) to match 1 or more letters.\n"; print " WORD --> "; chomp( my $word = ); $word =~ s/\-/\\w/g; $word =~ s/\*/\\w*/g; $word =~ s/\+/\\w+/g; open WORDLIST, "< WORD.LST" || die "Cannot open WORD.LST: $!\n"; while () { chomp( my $newWord = $_ ); if ( $newWord =~ m/^$word$/i ) { print $newWord . "\n"; } } close WORDLIST;