my @arr = qw( bar qux foo qux2 bar2 foo foo3 ); my $marker = "foo"; my $seen_marker; my @wanted = grep { $seen_marker ||= ($_ eq $marker) } @arr; print "@wanted"; __END__ foo qux2 bar2 foo foo3
In reply to Re: Construct for Skipping and Continue
by rhesa
in thread Construct for Skipping and Continue
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |