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


in reply to Re: Burned by precedence rules
in thread Burned by precedence rules

Many would find that better expressed as:

sub done { my $self = shift; return 1 unless $self->foo or $self->bar; return; }

because it avoids the two negations which confuse the meaning of the and.

I used to avoid using unless, partly because none of the other languages I've used have had such a thing, but where it drops out a layer of negation I find it helps clean up intent quite nicely.


Perl's payment curve coincides with its learning curve.