in reply to Pseudo-switch question

Personally, I often nest ternaries when faced with such a case.
$foo ? do { bar($_) for 1..3; } : $baz eq $quux ? (warn, return -1) : $answer == 42 ? print "but what's the question?\n" : print "who knows\n";

To my sense of aesthetics, this is quite pleasing. Of course, it only works well if the code for each case isn't very long, otherwise it breaks apart visually.

The only thing I don't like about it is the default case's treatment in formatting - I can't decide whether to line it up, indent it, or how to otherwise make it obvious as default case. Right now, I'm thinking unconditionally wrapping it in a do block and leaving it at the same indentation level as the conditionals (which is where it logically belongs - it just doesn't seem to stand out enough by itself). As in

$foo ? do { bar($_) for 1..3; } : $baz eq $quux ? (warn, return -1) : $answer == 42 ? print "but what's the question?\n" : do { print "who knows\n" };
I quite like this solution now that I'm looking at it. Maybe I can finally make up my mind.

Makeshifts last the longest.