in reply to flip-flop operator and sequence number
When the flip-flop operator in scalar 'flips' (when the left hand side is true), it starts at 1 and counts up until it 'flops' (when the right hand side is true). So, skip to the next element when the return value equals 1.
Also, when the flip-flop operator 'flops', it appends 'E0' to the return value. For example, if it finds five matches in a row, it will return (1, 2, 3, 4, '5E0'). So, you should also skip to the next element when the return value contains an E.
Here's how this might be coded:
foreach (@data){ next unless $check = /start/ .. /stop/; next if $check == '1' or $check =~ /E/; # do stuff }
|
|---|