You could pre-program your pattern, which imho is elegant and transparent and easily adaptable to more complex situations.
@pat = ( 0, 1, 1, 0 ); $i = 0; @result = grep { $pat[ $i++ % 4 ] } 0..12;
I guess you could also replace "4" with "@pat" to make it even more general.
In reply to Re: Grep Pattern
by hdb
in thread Grep Pattern
by GotToBTru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |