Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Why I Hate Nested If-Else blocks

by dws (Chancellor)
on Jan 04, 2002 at 02:33 UTC ( #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
Node Status?
node history
Node Type: note [id://136125]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-10-24 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls