Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: foreach loop

by InfiniteSilence (Curate)
on May 14, 2014 at 13:49 UTC ( #1086028=note: print w/ replies, xml ) Need Help??


in reply to foreach loop

For every nth you can use modulus operator:

perl -e 'for(1..100){ if($_%6==0){print qq|$_ sixth\n|;} };' 6 sixth 12 sixth 18 sixth 24 sixth 30 sixth 36 sixth 42 sixth 48 sixth 54 sixth 60 sixth 66 sixth 72 sixth 78 sixth 84 sixth 90 sixth 96 sixth

Celebrate Intellectual Diversity


Comment on Re: foreach loop
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1086028]
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: (9)
As of 2014-11-23 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (133 votes), past polls