Subject: | Net::OpenID::Consumer uses $& which makes ALL regexes slow |
Using $& makes all use of Regexes in a Perl program slow, if I change the ejs
sub to this:
sub ejs
{
my $a = $_[0];
$a =~ s/([\"\'\\])/\1/g;
# $a =~ s/[\"\'\\]/\\$&/g;
$a =~ s/\r?\n/\\n/gs;
$a =~ s/\r//;
return $a;
}
Then my program takes 19 seconds instead of the previous 120 seconds.