in reply to Re^2: Flip-flop won't DWIM
in thread Flip-flop won't DWIM
Your code prints "A B C D E F" for me, and I cannot see why it would print anything else.
This seems to work if you insist on using flip-flop:
However, you could copy stuff from List::MoreUtils.$x = 1; print join " ", grep { $x..(($x=0) or /D/) } qw(A B C D E F);
|
---|
In Section
Seekers of Perl Wisdom