laziness, impatience, and hubris | |
PerlMonks |
Re: Strange interaction between print and the ternary conditional operatorby kcott (Archbishop) |
on Feb 20, 2020 at 07:22 UTC ( [id://11113231]=note: print w/replies, xml ) | Need Help?? |
G'day WingedKnight, Welcome to the Monastery. When in doubt, it's often a good idea to find out how Perl is seeing your code with B::Deparse.
"Why isn't " bar" getting appended to the output in the second case?" Because it's getting appended to the return value from print.
Of course, you should start all your code with:
In this case, you would have received warnings:
See "perlintro: Safety net". — Ken
In Section
Seekers of Perl Wisdom
|
|