- 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 redo Function
Description
This function restarts the current loop without forcing the control statement to be evaluated. No further statements in the block are executed. A continue block, if present, will not be executed. If LABEL is specified, execution restarts at the start of the loop identified by LABEL.
Syntax
Following is the simple syntax for this function −
redo LABEL redo
Return Value
This function does not return any value.
Example
Following is the example code showing its basic usage −
#!/usr/bin/perl -w $c = 1; $d = 4; LABEL: { $c++; $e = 5; redo LABEL if ($c < 3); $f = 6; last LABEL if ($e > 3); $g = 7; } $h = 8; print ("$c $d $e $f $g $h\n");
When above code is executed, it produces the following result −
3 4 5 6 8
perl_function_references.htm
Advertisements