Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Grep Pattern

by Eily (Monsignor)
on Dec 12, 2018 at 14:39 UTC ( #1227148=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1227148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2019-11-15 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (85 votes). Check out past polls.

    Notices?