in reply to Slow Regex - How to Optimize
I'd try a non-greedy quantifier...
...and maybe a more generic subroutine finder...if ( $line =~ /[^a-zA-Z]$sub[^a-zA-Z]*?\(/ ) {
foreach my $line ( @sub_code ) { if ($line =~ /[^a-zA-Z]([a-zA-Z_]+[a-zA-Z_0-9]*)[^a-zA-Z]*\(/ and exists $SUBS{$1}) { push @subs, $key } }
|
---|
In Section
Seekers of Perl Wisdom