Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 radiator hisses contentedly...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (None)
    As of 2017-09-22 01:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      During the recent solar eclipse, I:









      Results (255 votes). Check out past polls.

      Notices?