in reply to Profiling code

You will probably find this article:

Profiling in Perl
useful.

HTH,

planetscape