Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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
Replies are listed 'Best First'.
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 surveying the Monastery: (9)
As of 2015-07-30 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls