Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: How can I improve the efficiency of this very intensive code?

by polettix (Vicar)
on Aug 07, 2005 at 00:07 UTC ( #481576=note: print w/replies, xml ) Need Help??


in reply to Re^3: How can I improve the efficiency of this very intensive code?
in thread How can I improve the efficiency of this very intensive code?

This is exactly what I was going to suggest, apart from a minor optimisation regarding the initialisation of the first value. The I recalled of the existence of reduce in List::Util, which does the job nicely. But maybe I should have been less cryptic and explain what the solution does exactly - thanks for the example, I'll update my post linking to it :)

I know it's a corner case that should not happen, but I'd check for $i2 to be defined before comparing it against $id2.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2020-06-06 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (41 votes). Check out past polls.

    Notices?