c r <[EMAIL PROTECTED]> wrote:Thanks for replying!
 
Are you certain that using the module makes the simultaneous matching faster than a 
sequential and to what degree (roughly)? 

Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
C R wrote:
> I need to match an expression and its reverse to a very long
> string.
> When a match occurs all matching should stop and the position of
> the match should be returned.
> 
> Question1: can I match the forward and reverse expression to the
> string on the same time and

You can make use of alternation (the '|' character).

> thereby save half the time it normally would take to find a match
> or does the matching just get slower?

Intuitively I'd guess it's faster, but to know you need to do a
benchmark.

> Question2: is the "fork" function what I should use in order to
> match a string with multiple expressions simultaneously?

Aha, did you mean "at the same time" in that sense? Maybe, if the
string is really, really log. You may e.g. want to check out the
module Parallel::ForkManager.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Reply via email to