In a first approximation, I just ran
egrep -r '\<(use|require)\>' /path/to/source/*
Then spend a couple of days cleaning it up. This will give you a list of all used or required modules.
You can also play with @INC
to exclude specific library paths.
If you are trying to determine the execution path, you can run the code through the debugger with "trace" enabled (ie, "t" in the debugger), and then redirect the output to a text file for further analysis. I know this is difficult when starting CGI ...
source share