Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How do you uncover needless module loads or missing loads in code.

by hesco (Deacon)
on Jul 15, 2009 at 21:57 UTC ( [id://780492]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://780492]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-19 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found