2010/1/9 C.DeRykus <dery...@gmail.com>: > On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote: >> 2010/1/5 Jeff Peng <jeffp...@netzero.net>: >> ... >> >> This is something that Perl (post version 5.6) does inherently, which >> is compiling a regex only once as long as the pattern isn't modified. > >> Prior to 5.6 you'd need to use the /o modifier ( >> m/href="http:\/\/(.*?)\/.*" target="_blank"/o ). >> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Are you sure about that? AFAIK, even pre-5.6, the /o modifier > only affected regexes that needed to interpolate variables.
That's how I read the FAQ, I have zero experience with Perl prior to 5.6. When a regex is placed inside a loop, there is a chance that the implementation would re-evaluate, or re-compile it for each iteration. Whether Perl did that or not is unclear from the contemporary documentation. -- Erez "The government forgets that George Orwell's 1984 was a warning, and not a blueprint" http://www.nonviolent-conflict.org/ -- http://www.whyweprotest.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/