Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: the '..' operator and decreasing values

by jhourcle (Prior)
on Mar 05, 2005 at 02:17 UTC ( [id://436835]=note: print w/replies, xml ) Need Help??


in reply to Re: the '..' operator and decreasing values
in thread the '..' operator and decreasing values

You might prefer

for ( my $i = 10; $i--; ) { # do something }

I regularly walk array indexes backwards, as you can shave a few cycles off of the standard

for ( my $i = 0; $i < $array_size; $i++ ) { # whatever }

logic that people love using in those languages that don't have a 'foreach' command.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found