http://qs321.pair.com?node_id=11119330


in reply to Re: Why is $a.$b not = "$a$b"?
in thread Why is $a.$b not = "$a$b"?

Thank you tybalt89!

Good answer!  Short, but good.

To expand on that, Perl's operator precedence has '=~' higher than '.'.
So to get the '.' notation to work as I want it to, I assume I should (parenthesise) it, like this:

$ perl -e '$a="A";$b="B";print "Matches!\n" if ($a.$b) =~ /A/' Matches! $ perl -e '$a="A";$b="B";print "Matches!\n" if ($a.$b) =~ /C/'
'eq' is lower than both of those, which explains why my 'eq' tests worked as I expected.

Right?