Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What's the meaning of die ref $res... ?

by Utilitarian (Vicar)
on Jan 12, 2012 at 17:01 UTC ( #947582=note: print w/ replies, xml ) Need Help??


in reply to What's the meaning of die ref $res... ?

Look for the Ternary operator in the perlop doc.

ref $res ? $res->faultstring : $soap->transport->status
Could be written as
if (ref $res){ #$res is a reference and not a scalar die $res->faultstring; # exit printing the fault } else{ die $soap->transport->status; #Exit with the current transport statu +s of the SOAP object }
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re: What's the meaning of die ref $res... ?
Select or Download Code
Re^2: What's the meaning of die ref $res... ?
by miguelele (Beadle) on Jan 13, 2012 at 09:17 UTC
    Thank you, I get it now! It is no easy to make a search for "ref" or "?" or ":"
    Regards
      Indeed, until you know what it's called (at which point you probably understand it) searching for the ternary op can be difficult ;)
      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-12-25 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls