Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Autogenerate descending arrays

by bl0rf (Pilgrim)
on Mar 14, 2004 at 21:52 UTC ( #336544=note: print w/ replies, xml ) Need Help??


in reply to Autogenerate descending arrays

aah! I completely forgot about reverse!
Thank you fellow monks for your feedback, testing also shows that reverse is twice as fast as my method. I'm happy there's more than one way to do it ( or anything ).


Comment on Re: Autogenerate descending arrays
Re: Re: Autogenerate descending arrays
by kappa (Chaplain) on Mar 14, 2004 at 22:08 UTC
    By the way, using reverse is faster because this case is optimized as the action mentioned in the subject is very common :)
      How is it optimized?
        I stand corrected. Looks like foreach (reverse 1 .. 1000000) still generates a huge temporary list.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-10-21 11:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (100 votes), past polls