Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Strange interaction between print and the ternary conditional operator

by davido (Cardinal)
on Feb 20, 2020 at 16:13 UTC ( [id://11113255]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $call_resp = print(1 ? 'yes' : 'no)   .   'bar';  # yes
    print "\nprint() function returned: $call_resp\n";   # \nprint() funct
    +ion returned: 1bar\n
    
  2. or download this
    (print 1 ? 'yes' : 'no') . 'bar';
    
  3. or download this
    print +(1 ? 'yes' : 'no') . "bar\n"; # yesbar\n
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found