in reply to Re^2: Empty qr// fails to match -- Is this known bug? (bug)
in thread Empty qr// fails to match -- Is this known bug?
Right, the problem to me is that $U = qr/$some_user_provided_input/, and this is very unexpected behavior.
I agree with tye and not almut: since "$U" ne "", /$U/ shouldn't be an empty pattern, so perlop's condition for empty // matching shouldn't apply.
But after a bit of investigation, it seems that Perl always takes a shortcut: when $rx = qr/foo/, /$rx/ turns into /foo/. Which explains this behavior, but I still think it's a bug.
|
|---|