perlquestion
GotToBTru
<p>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:</p>
<code>$i = 0;
@result = grep { $i = 0 unless ($i<4); $i++%3 ? 1 : 0; } 0..12</code>
<p>@result = 1,2,5,6,9,10</p>
<p>It works but looks clunky. Any more elegant options?</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-844862">
<center>But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)</center>
<hr/>
</div></div>