Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 rifling through the Monastery: (15)
As of 2015-07-28 14:40 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 (256 votes), past polls