VOOZH about

URL: https://www.geeksforgeeks.org/perl/perl-last-in-loop/

⇱ Perl | last in loop - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perl | last in loop

Last Updated : 27 Feb, 2019
last keyword is used to loop control statement which immediately causes the current iteration of the loop to become the last. If a label given, then it comes of the loop by the label.
Syntax: # Comes out of the current loop. last # Comes out of the loop specified by # MY_LABEL last MY_LABEL
Example 1: Output:
Sum = 11
Exiting the loop
Loop ended at Sum > 10
Example 2: Output:
Sum is 22
Comment
Article Tags:

Explore