Don't use until, unless...

In Perl 5, until is a negated version of while. Instead of writing this:

while (defined(my $i = $iter->next())) {
    say $i;
}

Using until allows you to write this:

until (!defined(my $i = $iter->next())) {
    say $i;
}

until is documented under the "Compound Statements" heading of …

About Tom Ryder

user-pic Banging out Perl to help keep my corner of the internet from falling over. TEJR on CPAN.