Loop::ControlFIRST and NEXT functions for loops | |
Download |
Loop::Control Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Marcel GrĂ¼nauer
- Publisher web site:
- http://search.cpan.org/~marcel/
Loop::Control Tags
Loop::Control Description
FIRST and NEXT functions for loops Loop::Control is a Perl module that provides ways to execute code at certain points in a for or while loop that are outside the normal control flow. For example, you could have code that executes only during the first iteration of a loop, or code that executes after every iteration of the loop, regardless of how the iteration ended (normally or via next).SYNOPSIS use Loop::Control; for (1..10) { FIRST { print "called only in the first iteration" }; FIRST { print "also called only in the first iteration" }; # do things NEXT { print "called at the end of each iteration" }; NEXT { print "also called at the end of each iteration" }; # do more things next if rand() < 0.5 # the NEXT code will be executed even if the loop is ended with next() } Requirements: · Perl
Loop::Control Related Software