in reply to flip-flop operator and sequence number

I don't like the idea of copying chunks of code either.

I notice you already got answers on how to tell when it flips or filter out the first/last without retesting, but I wanted to make a note on this specific point of repreating the RE.

my $start= qr/start/; # note the regex's once my $stop= qr/stop/; foreach (grep /$start/ .. /$stop/, @data) { next if /$start/; last if /$stop/; # ....