Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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

by tye (Sage)
on Jan 07, 2002 at 21:10 UTC ( #136855=note: print w/ replies, xml ) Need Help??

in reply to (jeffa) 2Re: (Ovid - Why I love nested If-Else blocks)
in thread Why I Hate Nested If-Else blocks

I don't see anything that improved on the nested if/else blocks so far. You have 6 cases so you are going to end up with six cases. You could factor out the common code like so:

{ no strict 'refs'; &{ ( $foo < 7 ? "" : "other_" ) . ( $bar ? "bar" : $baz ? "baz" : $qux ? "qux" : last ) . "_func" }( $foo ); }
but that is pretty obfuscated. (:

        - tye (but my friends call me "Tye")

Comment on (tye)Re: (Ovid - Why I love nested If-Else blocks)
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-12-01 05:32 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (794 votes), past polls