in reply to perl 5.8.8 equivalent of ?|

Just use a simple /(?: instead of /(?|, and then if there's a mathc, the magical $+ variable will contain what you need.

Replies are listed 'Best First'.
Re^2: perl 5.8.8 equivalent of ?|
by Anonyrnous Monk (Hermit) on Dec 13, 2010 at 09:10 UTC

    Using $+ only works with one capture per alternation, though.  In other words, it's not a general substitute for (?|...).

      True. The general substitute (even more general than /(?| is) is named captures, but sadly those too aren't available in perl 5.8.8; or the defined-or operator like $1//$2, which too isn't in perl 5.8.8.