http://qs1969.pair.com?node_id=481375

There has been discussion in the ChatBox recently about the need for unless. It was triggered by the suggestion that Perl should have an otherwise for use as a modifier:

a if b; c otherwise;

which looks ok iff the otherwise binds to the condition in the previous if. But do we need otherwise when we have unless? Consider:

a if (my $o) = b; c unless $o;

Then again, do we need unless. Many people find if ! $o at least as readable as unless $o and actually should be preferred because we are lazy, right?

When experienced Perlers (no, no, not me!) stand up in public and admit that they have fallen into traps posed by unless, perhaps it is time to deprecate the useless thing?


Perl is Huffman encoded by design.