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 we would expect. However, if we do...:

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

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


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