First, grab a perl reference (e.g. The Camel or The Llama) if you haven't already got at least a smattering of perl knowledge. Secondly, do a
search for Math modules at CPAN. This should get you started.. then come back with more specific questions if you need more help. Good luck.