Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Naughty Regular Expressions and mod_perl

by Juerd (Abbot)
on Dec 21, 2003 at 16:39 UTC ( [id://316211] : note . print w/replies, xml ) Need Help??


in reply to Naughty Regular Expressions and mod_perl

sub killperformance { eval q{ use re qw(debug); $&; }; }

The re pragma is not lexical :( This is a terrible performance killer, most of the time even worse than $&. And since the output goes to stderr, which is the error log under mod_perl, it can take a while to discover that it's still in effect globally.

Three very well known and widely used modules that use $& are Parse::RecDescent, Text::Balanced and XML::Twig.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }