http://www.perlmonks.org?node_id=1099228


in reply to Improving the Nested For Loop

PDL::Stats::Basic can calculate correlations for you. And it probably does it faster than you do, so give it a try!