On 9 Mar 2011, at 03:01, Ben Lavery wrote:
> I shall change from a hash to an array and use grep, or looking into it I may
> use List::MoreUtils as it has a "first_value" sub which should make it
> somewhat more efficient.
OK, so about an hour after I wrote this I was on the train home thinking
"stupid idiot".
If I use "first_value" from List::MoreUtils then there is no point me in using
wildcards for searching...
I have tried using grep, but with the number of elements I have, it's taking
forever...On my Mac Pro it's taking more than ten minutes (I gave up after
that).
My thoughts are:
if @letters have one or more wildcards in ( . )
Generate all combinations of a-z (permutations don't matter at this stage)
for wildcards
For each combination generated above
Add combination to temp array containing other entries from @letters
Generate all combinations and permutations of this temp array, store
results in @all_possible_combinations
For each $element in @all_possible_combinations
Does $element appear in %word_list
I've just got to work out the Perl now :P
Ben