Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Keeping a Count in foreach

by robobunny (Friar)
on Jun 17, 2002 at 15:32 UTC ( [id://175104]=note: print w/replies, xml ) Need Help??


in reply to Keeping a Count in foreach

if you don't want to use a counter, how about:
foreach $index (0..$#s) { print "$index: $s[$index]\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found