http://www.perlmonks.org?node_id=136855


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")