http://qs321.pair.com?node_id=1227148


in reply to Grep Pattern

Having a TTFFTTFF... pattern is quite easy:

DB<11> $i = 0; say for grep { $i++ % 4 < 2 } 0..12 0 1 4 5 8 9 12
And starting at the fourth value in the pattern just means your start at the fourth value of $i:
DB<12> $i = 3; say for grep { $i++ % 4 < 2 } 0..12 1 2 5 6 9 10