Perl: the Markov chain saw | |
PerlMonks |
Re: Simple regex wordlist questionby atemon (Chaplain) |
on Sep 11, 2007 at 05:04 UTC ( [id://638225]=note: print w/replies, xml ) | Need Help?? |
Your code is checking each line in the file with the input string. For that another way to do is, get all permutations from the input string, then compare each line in the file with all the permutations you got. To get all permutations, you can use Math::Combinatorics. Get all permutations into an array and you can use grep to compare. I have updated your code and is working fine for me. The code I updated is
Update: Fixed typo. Cheers ! --VC There are three sides to any argument..... your side, my side and the right side.
In Section
Seekers of Perl Wisdom
|
|