in reply to flip-flop flop

I didn't know that if the right hand (reset) expression doesn't match, flip-flop to keep it's state, like closure.

How about putting sentinel to the list, which surely reset flip-flop state?

sub blah3 { my($look_for, @array)=@_; my @elements_we_want = grep { $_ eq $look_for .. $_ eq 'MY SENTINEL'} @array,'MY SENTINEL +'; return @elements_we_want[ 1 .. $#elements_we_want -1]; }
not elegant? I like flip-flop since Marshall introduced me at Parsing a file and finding the dependencies in it