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


in reply to Re: Grep Pattern
in thread Grep Pattern

That's the approach I would recommend as well. But you kinda messed up on the implementation.
my @pat = ( 0, 1, 1, 0 ); my @result = grep { $pat[ $_ % @pat ] } 0..12;