Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Smoothsort

by Laurent_R (Canon)
on Sep 20, 2015 at 08:44 UTC ( #1142545=note: print w/replies, xml ) Need Help??


in reply to Re: Smoothsort
in thread Smoothsort

Hi Athanasius,

your point about the range-computing subroutine being called only once when using a Perl-style foreach loop (as compared to the "equivalent" C-style loop) is very interesting.

I sometimes wondered, in similar cases, whether I should pre-compute the range limits in order to sort of cache them before entering the for loop, but never actually cared to check, now I know that, in such cases, Perl is actually doing the value caching for you. Good to know. Thank you, Athanasius.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2020-11-27 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?