in reply to Performance of assambled regex
Perhaps using the o modifier would help:
Update: or rather:while(<$fh_big_file>) { print if (/MY_HUGE_REGEX_JUST_PLAIN/../^END_OF_BLOCK/o); }
Update 2: sorry, wrong copy and paste (and thanks to shmem for pointing out):while(<$fh_big_file>) { print if (/MY_HUGE_REGEX_JUST_PLAIN/o .. /^END_OF_BLOCK/); }
while(<$fh_big_file>) { print if (/$regex/o .. /^END_OF_BLOCK/); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Performance of assambled regex
by shmem (Chancellor) on Jul 26, 2015 at 12:58 UTC |