in reply to Efficient regex search on array table
Some suggestions:
Use Devel::NYTProf to actually benchmark properly and really see where your time is going.
Use the 'next' key word to go to the next item iteration in the loop when you know the row cannot match anymore, you don't need those rX counters. Example:
if ($regex1) { next if (( $accpyn1) && ($line1 =~ m/$regex1/)); next if ((!$accypn1) && ($line1 !~ m/$regex1/)); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Efficient regex search on array table
by Polyglot (Chaplain) on Dec 15, 2022 at 03:07 UTC | |
Re^2: Efficient regex search on array table
by Polyglot (Chaplain) on Dec 19, 2022 at 01:49 UTC |
In Section
Seekers of Perl Wisdom