in reply to correlation

Have a look at the CPAN statistics modules.

Hope this helps, -gjb-