http://www.perlmonks.org?node_id=1227147

GotToBTru has asked for the wisdom of the Perl Monks concerning the following question:

I want to apply a F T T F repeating pattern as a filter to an array or list. Here is what I came up with:

$i = 0; @result = grep { $i = 0 unless ($i<4); $i++%3 ? 1 : 0; } 0..12

@result = 1,2,5,6,9,10

It works but looks clunky. Any more elegant options?

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)