in reply to Re: An optimization of last resort: eliminate capturing from your regexps
in thread An optimization of last resort: eliminate capturing from your regexps

Making that a flag on Perl is a horrible idea. Quick, I want to speed up my program, can I use that flag? I dunno, do you want to go through all of the modules you import and didn't write?

Make that a flag on the regular expression instead. Then people can turn it on when they find a critical part of their code to optimize. And don't have to worry about looking through modules written by other people.

As tye pointed out, I misread. Sorry.

  • Comment on Re^2: An optimization of last resort: eliminate capturing from your regexps

Replies are listed 'Best First'.
Re^3: An optimization of last resort: eliminate capturing from your regexps (//k)
by tye (Sage) on Jul 12, 2006 at 02:51 UTC

    Am I misunderstanding you or did you just not notice the second paragraph:

    $str =~ /Hulk hate (\w+)/k;

    Note that demerphq has added /k to his regex. I don't see demerphq proposing any per-script or per-invocation flag that you seem to have imagined.

    - tye