Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex speed issue

by tlm (Prior)
on Aug 30, 2005 at 12:15 UTC ( [id://487721]=note: print w/replies, xml ) Need Help??


in reply to Regex speed issue

How about

$this->{ template } =~ s/$re/$this->replacement( $callback, $key, $1, +$2 )/eg;
where
sub replacement { my $this = shift; my ( $cb, $key, $first, $second ) = @_; return $cb->( $key, $this->mask_block_params( $first, $second ) ); }
I don't know if this is any faster than what you have, but at least it avoids the use of evil variables.

the lowliest monk

Replies are listed 'Best First'.
Re^2: Regex speed issue
by mtsachev (Initiate) on Aug 30, 2005 at 15:03 UTC
    This executes in approximately the same time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://487721]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found