Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Grep Pattern

by Eily (Monsignor)
on Dec 12, 2018 at 14:39 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1227148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found