Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Why I Hate Nested If-Else blocks

by dws (Chancellor)
on Jan 04, 2002 at 02:33 UTC ( [id://136125]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      if ( ! ref $_[0] ) {
          return undef;
      } else {
          blah($_[0]);
      }
    
  2. or download this
      return undef unless ref $_[0];  # guard clause
    
      blah($_[0]);
    

Log In?
Username:
Password:

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

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

    No recent polls found