In the absence of something more sophisticated, I'd be grabbing the clock() values at various points, and using that to work out where the time is being spent.
should give you the time in seconds. As I understand it, clock() itself returns the number of cpu cycles that have been run since the program began execution.
But, of course, this is perl and there may well be something "more sophisticated".