Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: foreach only for a section of a list

by Utilitarian (Vicar)
on May 04, 2012 at 15:01 UTC ( #968935=note: print w/ replies, xml ) Need Help??


in reply to foreach only for a section of a list

perl -e '@set=qw(a b c d);for (@set[0..$#set - 1]){print "$_\n";}' a b c
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re: foreach only for a section of a list
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-07-26 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls