programming-examples/perl/Statement/Using block labels with next.pl

4 lines
165 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
LOOP: for ( $number = 1; $number <= 10; ++$number ) {
next LOOP if ( $number % 2 == 0 );
print "$number "; # displays only odd numbers
}