- Perl Basics
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl Advanced
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Useful Resources
- Perl - Discussion
Perl next Function
Description
This is not a function, it causes the current loop iteration to skip to the next value or next evaluation of the control statement. No further statements in the current loop are executed. If LABEL is specified, then execution skips to the next iteration of the loop identified by LABEL.
Syntax
Following is the simple syntax for this function −
next LABEL next
Return Value
This function does not return any value.
Example
Following is the example code showing its basic usage −
#!/usr/bin/perl -w @list = (1,2,3,4,5,5,3,6,7,1 ); foreach $key ( @list ) { if( $key == 5 ) { next; } else { print "Key value is $key\n"; } }
When above code is executed, it produces the following result −
Key value is 1 Key value is 2 Key value is 3 Key value is 4 Key value is 3 Key value is 6 Key value is 7 Key value is 1
perl_function_references.htm
Advertisements