Basic Profiling
SmallProfThis module is available on rpmforge as perl-Devel-SmallProf
$ perl5 -d:SmallProf test.pl
This creates a file smallprof.out which for each line of perl code lists the number of times the line was invoked, the total wall time spent in that line, and the total cpu time spent in that line.
To sort by total wall time for each line:
$ sort -k 2nr,2 smallprof.out | less