programming-examples/perl/Statement/Using a label.pl

16 lines
359 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
$total = 0;
$firstcounter = 0;
DONE: while ($firstcounter < 10) {
$secondcounter = 1;
while ($secondcounter <= 10) {
$total++;
if ($firstcounter == 4 && $secondcounter == 7) {
last DONE;
}
$secondcounter++;
}
$firstcounter++;
}
print ("$total\n");