in reply to Re^3: Pugs configuration - file locations
in thread Pugs configuration - file locations

Why?

It seems more reasonable to tell the regex engine it has an easier job, close to where it is invoked rather than converting the result. IAC, both forms are taken by Pugs, and every variation (even with no ? ) give the same error.

  • Comment on Re^4: Pugs configuration - file locations

Replies are listed 'Best First'.
Re^5: Pugs configuration - file locations
by moritz (Cardinal) on Feb 27, 2008 at 09:24 UTC
    It seems more reasonable to tell the regex engine it has an easier job, close to where it is invoked rather than converting the result.

    Note that a regex match has side effects like setting $0, $1 etc., and the full match object is still available in $/ even if the match is performed in boolean context.

    So the optimatzion had to a lot smarter than just detecting boolean context (which propagates anyway, so it's not a question of the used syntax).