programming-examples/perl/Statement/Print out even numbers with a do...while loop.pl

13 lines
145 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl
use warnings;
use strict;
my $n = 0;
do {
{
next if ($n % 2);
print $n, "\n";
}
} while ($n++ < 10);