News for hackers. Stuff that matters.
Re:Why I Like Ruby by draegtun on Friday July 16, 2010 @06:28AM (#1520788)
Damian Conway in Perl Best Practices recommends not to use negative control statements at all (unless and until).

So this would be a no-no:

    unless ($this > $that) {
        do_something();
    }
He's happy they're used to postfix statements however he says that these should only be used for flow control. For eg.

    for my $i (@list) {
        next unless $i % 2 == 0;
        do_something();
    }
Re:Why I Like Ruby by draegtun on Friday July 16, 2010 @10:20AM (#1521207)
Correction: Conway says don't use postfix unless, for, while or until

So last example should be:

    for my $i (@list) {
        next if not $i % 2 == 0;
        do_something();
    }
Personally I don't follow the bible to the letter :) I do use prefix & postfix unless but only with simple truth conditions like this:

    unless ($this) { ... }

    next unless $this;