At DB<2> below the result is '1' instead of the
'b' I expected.
It seems like the regexp is getting
a scalar context for some reason.
What is going on?
DB<1> ($a) = ("abc" =~ /a(b)c/); print $a b DB<2> ($a) = (("abc" =~ /a(b)c/) || 'd'); print $a 1 DB<3>($a) = (("ac" =~ /a(b)c/) || ('d')); print $a d
In reply to Regexp context with || by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |