But is the ternary-using version really cleaner / clearer to understand than the if/elsif/else chain ?

Lisp's cond macro is very nice in small functions, but I've seen Lisp function reaching the size of a page (and many have a big cond as their main bulk), it's very hard to follow their logic. I'm starting to think that though if/elsif/else adds a lot of syntax, it's in fact simpler to understand.

Switches are simpler to follow than conds, because they talk about a single variable, not arbitrary conditions.


In reply to Re^2: Perl can do it, take 1 (sentence generation) by spurperl
in thread Perl can do it, take 1 (sentence generation) by spurperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":