Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Slow Regex - How to Optimize

by ikegami (Pope)
on Aug 30, 2005 at 22:10 UTC ( #487968=note: print w/ replies, xml ) Need Help??

in reply to Slow Regex - How to Optimize

Maybe using a generic regexp, then checking against %SUBS would be better? That eliminates a nested loop and multiple regexp compilations.

foreach my $line ( @sub_code ) { if ( $line =~ /(\w+)\(/ ) { if ( exists $SUBS{$1} ) { push( @subs, $1 ); } } }

Note: I assumed %SUBS keys are subroutine names, not regexps.

Comment on Re: Slow Regex - How to Optimize
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2016-02-10 14:13 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (347 votes), past polls