Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by tye (Sage)
on Jan 07, 2002 at 21:10 UTC ( [id://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")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-23 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found