perl -d:DProf test.pl
When the script terminates (or when the output buffer is filled) the profiler will dump the profile information to a file called tmon.out. A tool such as dprofpp can be used to interpret the information. The following command will print the top 15 subroutines that used the most time:
dprofpp
To print an execution graph of the subroutines in the script, use the following command:
dprofpp -T
Copyright © 2002 O'Reilly & Associates. All rights reserved.