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

Re: (jeffa) 2Re: (Ovid - Why I love nested If-Else blocks)

by runrig (Abbot)
on Jan 04, 2002 at 03:46 UTC ( #136146=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $func = ($foo > 7) ?
         $bar && \&bar_mysub
    ...
      :  $bar && \&bar_other_mysub
      || $baz && \&baz_other_mysub;
    $func->($foo) if $func;
    
  2. or download this
    my $func = ( $foo > 7 )
      ? $bar && \&bar_mysub
    ...
      || $bam && \&bam_other_mysub
      || $bak && \&bak_other_mysub;
    $func->($foo) if $func;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-09-17 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (61 votes), past polls