Have a look at Profiling your code.
In reply to Re: CPU utilization of a perl program by kyle in thread CPU utilization of a perl program by Akoya