use CGI;
my $q = CGI->new();
Then you will be able to tell if I have actually used that module? A huge portion of modules are not OO and export functions that do not need the module name to be invoked. Additionally, the module may be exporting constants.
The best this method can do is attempt to confirm actual use. Even then it is subject to break since the module name may appear in comments or code as false positive. Even reducing the comments and POD with perl -MO=Deparse will not be fool proof. Your method will not be a good indicator of modules not actually being used and will be a poor indicator of modules that are being used.
|