Just another Perl shrine | |
PerlMonks |
Re^2: counting instances of one array in another arrayby jsmagnuson (Acolyte) |
on Feb 24, 2012 at 11:07 UTC ( [id://955905]=note: print w/replies, xml ) | Need Help?? |
Thank you for this approach! This is about 10x faster than the next best approach that was suggested here that I tried implementing (which was this code from an AnonymousMonk):
This is good enough to get me going, but I will follow the other advice that was offered and learn about fleximal, PDL::Sparse, and hash-fu. I am very grateful for the generous advice from all of you! best, jim ps -- Slight tweak: abc=(0,1,2), and then 0+(1*26^1)+(2*26^2), etc. (i.e., a=0, z=25, and when string position > 0 you multiply the index of the character in that position by 26 raised to the power of the position).
In Section
Seekers of Perl Wisdom
|
|