Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: What modules are we actually using?

by eric256 (Parson)
on Apr 27, 2005 at 16:01 UTC ( [id://451999]=note: print w/replies, xml ) Need Help??


in reply to What modules are we actually using?

Just an idea:

Could you insert a coderef into @INC that would track which modules where loaded and record that info into a file or database. Then you run your shop as normal for a period of time and know what modules have been used. If you modules always use Strict maybe you could bastardize it to modify the @INC for you.

I'm not sure that is the perfect solution, but it might be a good way to see what modules actualy get used, it would require all the scripts to be run at least once though to ensure that there dependencies where captured and some things will have dynamic dependencies which will be trouble but you probably know what most of those are already.

Good luck and let us know if you find some spiffy solution.

Update: If you add

BEGIN { # look in cwd first unshift @INC => sub { warn "Loading $_[1]\n"; return undef; }; }
to the top of strict (still not sure this is the best place to put it, but it works as a kludge) then it prints all module uses to STDERR. You would of course want to modify it to do something more usefull in your case.


___________
Eric Hodges

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found