in reply to How do you uncover needless module loads or missing loads in code.

I'm dealing with a related but dissimilar issue myself at: fastcgi broke my Exports

(Please ignore my rush to judgement conveyed in the unfortunate title. I now suspect that fastcgi had nothing to do with this, still unresolved, issue).

In my attempts to sort out my own issue, I added the following debug code to my script:

{ $ENV{PATH} = "/bin"; foreach my $module (keys %INC){ my $result = `grep '^sub import' $INC{$module}`; if ($result){ print STDERR "The module: $module includes: \n$result \n"; } if($module =~ m/Account/){ print STDERR "The next module is: $module \n"; print STDERR `grep _GenerateAccountSummary $INC{$module}`; print STDERR "\n\n"; } } }
I've been using Data::Dumper to Dump(\@INC,\%INC,\%::,\%This::Module::,\%That::Module::), etc. Perhaps you might find these techniques helpful as well.

-- Hugh

if( $lal && $lol ) { $life++; }
  • Comment on Re: How do you uncover needless module loads or missing loads in code.
  • Download Code