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:
but that is pretty obfuscated. (: - tye (but my friends call me "Tye"){ no strict 'refs'; &{ ( $foo < 7 ? "" : "other_" ) . ( $bar ? "bar" : $baz ? "baz" : $qux ? "qux" : last ) . "_func" }( $foo ); }
In reply to (tye)Re: (Ovid - Why I love nested If-Else blocks)
by tye
in thread Why I Hate Nested If-Else blocks
by jeffa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |