in reply to Guidance needed in perl program for fast pattern matching algorithm.

Are you aware that Perl has the Boyer-Moore algorithm built-in to both index and regex searching? As it is implemented in C, it will run much faster than any similar algorithm (Horspool is a simplification of Boyer-Moore) implemented in Perl.

You might consider reading about study in docs and using it in conjunction with your Perl pattern matching code and see if it improves the performance any.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Guidance needed in perl program for fast pattern matching algorithm.