Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: return if defined

by Athanasius (Archbishop)
on Dec 20, 2012 at 12:02 UTC ( [id://1009727]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub my_find_or_create
    {
    ...
        return defined $existing_result ? $existing_result :
                                          $new_result;
    }
    
  2. or download this
        return $existing_result // $new_result;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-26 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found