Skip to content


Looping through an array, two elements at a time

This is interesting, if you ever need to loop through an array selecting two elements at a time:

http://flodhest.net/files/perl/benchmark/loop-two-elements.txt?embed=1

A for loop is much faster than abusing each to achieve the same end on a mutliple core machine, but the balance is about even on a single core box.
 

Posted in perl.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.