http://www.perlmonks.org?node_id=11113223

WingedKnight has asked for the wisdom of the Perl Monks concerning the following question:

Ran into a strange interaction between print and the ternary conditional operator that I don't understand. If we do...:

print 'foo, ' . (1 ? 'yes' : 'no') . ' bar';

...then we get the output...:

foo, yes bar

...as we would expect. However, if we do...:

print (1 ? 'yes' : 'no') . ' bar';

...then we just get the output...:

yes

Why isn't " bar" getting appended to the output in the second case?