VOOZH about

URL: https://www.geeksforgeeks.org/perl/perl-next-operator/

⇱ Perl | next operator - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Perl | next operator

Last Updated : 11 Jul, 2025
next operator in Perl skips the current loop execution and transfers the iterator to the value specified by the next. If there's a label specified in the program, then execution skips to the next iteration identified by the Label.
Syntax : next Label
Example 1:
Output:
Frequency of E in the Array: 2
  Example 2:
Output:
i = 0 and j = 0
As i == j, hence going back to outer loop

i = 1 and j = 0
i = 1 and j = 1
As i == j, hence going back to outer loop

i = 2 and j = 0
i = 2 and j = 1
i = 2 and j = 2
As i == j, hence going back to outer loop
Comment
Article Tags:
Article Tags:

Explore