コンテンツへスキップ

#!/usr/bin/perl
@A = ( 1000, 10000, 1001, 1002, 1003, 10030 ,10011,);
foreach $val (@A) {
        print "asigned number = [". $val . "]\n";
}

for ( my $i = 1000; $i < 99999; $i++ ) {
        print "i = [" . $i . "]\n";
        if ( ! grep($_ eq $i, @A ) ) {
                $unsignedNumber = $i;
                last;
        }
}

print "unasigned number = [" . $unsignedNumber . "]\n";