That's what the range operator (see perlop) was designed for:
use warnings; use strict; my @arr = qw( bar qux foo qux2 bar2 foo foo3 ); my $marker = "foo"; for (@arr) { next unless $_ eq 'foo' .. undef; print "$_\n"; }
Prints:
foo qux2 bar2 foo foo3
In reply to Re: Construct for Skipping and Continue
by GrandFather
in thread Construct for Skipping and Continue
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |