「Perl」do…while文でnextを使用するサンプル
構文
if(条件式){some code}
使用例
#! /usr/bin/perl
use strict;
use warnings;
my $n = 0;
do{
if ($n == 5) {
$n++;
next;
}
print $n;
$n++;
}while ($n < 10)
結果
0 1 2 3 4
Coding Changes the World
構文
if(条件式){some code}
使用例
#! /usr/bin/perl
use strict;
use warnings;
my $n = 0;
do{
if ($n == 5) {
$n++;
next;
}
print $n;
$n++;
}while ($n < 10)
結果
0 1 2 3 4