in reply to Finding words within a character set

Another approach is to note that multiple words map onto one set of characters. Load your dictionary, sorting each word by character, and store it all in a hash, like this:
my %anagrams; while (defined( my $dict_word = <> ) ) { my $sorted = sort split //, $dict_word; push @{$anagrams{$sorted}} = $dict_word; }
The keys are the first asciibetical permutation of each word set.

Next, since you want words that are a subset of the given char set, you'll have to run through the combinations of the char set, and check if there's a key that matches, giving you an array of words for each match. I leave that as an exercise for OMAR.

-QM
--
Quantum Mechanics: The dreams stuff is made of