in reply to Re^2: Empty pattern in regex
in thread Empty pattern in regex

// always matches, always returns TRUE, but it never changes $&.

That is not correct, in either aspect:

% perl -wle '"a" =~ /a/; "b" =~ // or print "did not match, did not re +turn TRUE"' did not match, did not return TRUE % perl -wle '"a" =~ /.*/; q{$& changed} =~ // and print $&' $& changed %

Replies are listed 'Best First'.
Re^4: Empty pattern in regex
by perlboy_emeritus (Scribe) on Oct 19, 2023 at 20:44 UTC

    I concede, I give up and I surrender. Too confusing, why I get the result I do and you get the results you do. I'll sit this one out and just study the results y'all get. :-)