in reply to Skipping array element in a loop
Not confusing at all. What you're asking about is probably next. Here's an example:
my( @array ) = qw/one two three four five/; foreach my $number ( @array ) { next if $number eq 'three'; print $number, "\n"; }
The output will be:
one two four five
In other words, 'three' is skipped by 'next'. If your loop has a continue{...} block, that portion will still be executed, even if you 'next'.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Skipping array element in a loop
by antioch (Sexton) on Aug 30, 2006 at 13:48 UTC |