Perl The syntax format is as follows: Execute the above program, and the output is as follows:
last
statement is used to exit the loop statement block, thus ending the loop
last
the statement after the statement is no longer executed
continue
statement blocks are no longer executed. 5.26.1. Grammar #
last [LABEL];
5.26.2. Flow chart #

Example #
#!/usr/bin/perl$a=10;while($a<20){if($a==15){#
exit a loop $a=$a+1;last;}print"The value of a is:$a\\n";$a=$a+1;}
The value of a is: 10
The value of a is: 11
The value of a is: 12
The value of a is: 13
The value of a is: 14