in reply to Re^2: Reset meaning of empty pattern?
in thread Reset meaning of empty pattern?

That's why I posted the other ones.

On the other hand, does it really matter? If the user does not expect $1 to be set by //, whether it has a value or is undef is irrelevant.

Replies are listed 'Best First'.
Re^4: Reset meaning of empty pattern?
by haukex (Archbishop) on Sep 01, 2018 at 16:52 UTC
    On the other hand, does it really matter?

    It does to me, since I inspect the results of the regex, including @+ to see how many capture groups there were.

    $ perl -wMstrict -le '""=~// or die; print for @+' 0 $ perl -wMstrict -le '""=~/(?:)/ or die; ""=~// or die; print for @+' 0 $ perl -wMstrict -le '""=~/()/ or die; ""=~// or die; print for @+' 0 0

    Updated examples.