in reply to Performance of assambled regex
Hi Foodeywo
I would discourage using /o modifier, because of this note in perlre for v5.22:
o - pretend to optimize your code, but actually introduce bugs
using qr// is much better practice, as you can control when the compilation happens. If you want to know exactly how perl handles your regexps you can use:
perl -Mre=debug -d -ne 'print if (/MYLARGEREGEX_HERE/../END_OF_BLOCK/)' inputfile > outputfile
-Mre=debug gives you nice output about regex compilation and matching
and
-d puts you into debugger.
Go through your program step by step with "s" debugger option.
Happy hacking,
natan
---- PS: my first post on PerlMonks. Hello everybody!
|
|---|