in reply to Re: RegEx Perl Code
in thread RegEx Perl Code

I ran a few benchmarks here on a "contrived" large regex and large dataset; although the speed increase through qr// isn't what you'd call large, it is at least significant. Should be noted, though, that the the so-called "evil" /o was the winner in this case.

At any rate, thats not to say qr// is bad. Personally, I think its great because it encourages modularity and readability in regular expressions.

Replies are listed 'Best First'.
Re: RegEx Perl Code
by Abigail-II (Bishop) on Jul 24, 2002 at 08:53 UTC
    When I run the benchmark you are referring to, I get a slight win for "None" over "qr". Your results showed a difference of about 10% - not what I call significant.

    I never said qr// is bad. I just argued against blindly using qr// for no other reason than <quote>it's a good thing to do</quote>. About the only benefit I've seen from qr// is that it interpolates like regular expressions, and not like double quoted strings. But the interpolation is only slightly different.

    Abigail