Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Strange interaction between print and the ternary conditional operator

by jwkrahn (Monsignor)
on Feb 20, 2020 at 07:20 UTC ( #11113229=note: print w/replies, xml ) Need Help??


in reply to Strange interaction between print and the ternary conditional operator

Also, try it with commas instead of concatenation and you won't need parentheses and you won't have this problem:

print 'foo, ', 1 ? 'yes' : 'no', ' bar';
print 1 ? 'yes' : 'no', ' bar';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11113229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-05-30 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (173 votes). Check out past polls.

    Notices?