Perhaps edit the sitecustomize.pl file so that every time Perl launches, it writes some information to the log and then analyzes it? Add something like sitecustomize.pl:
open (LOG, '>>',"absolutepathto/logfile.txt"); print LOG $0,"\t",$$,"\t",scalar(localtime),"\n"; open SELF, $0; while (<SELF>) { print LOG $_ if (/use|require/); } close SELF; print LOG "_" x 80,"\n"; close LOG;
EDIT: In addition, we forgot about the% INC hashes, so the code above can be rewritten as follows to add more data about which modules were actually loaded + include files needed for the do function:
open (LOG, '>>',"absolutepathto/logfile.txt"); print LOG $0,' ',$$,' ',scalar(localtime),"\n"; open SELF, $0; while (<SELF>) { print LOG $_ if (/use|require/); } close SELF; END { local $" = "\n"; print LOG "Files loaded by use, eval, or do functions at the end of this program run:\n"; print LOG "@{[values %INC]}","\n"; print LOG "_" x 80,"\n"; close LOG; }
Basil source share