in reply to Construct for Skipping and Continue
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
|
|---|