"be consistent" | |
PerlMonks |
Re: Removing unused Perl modulesby bliako (Monsignor) |
on Apr 22, 2021 at 07:33 UTC ( [id://11131582]=note: print w/replies, xml ) | Need Help?? |
Module::Used, Module::ScanDeps, Module::Extract::Use et al., Devel::TraceUse can all be useful in listing what modules you instructed perl to use (as opposed to what modules are "usefully used" which is what you want). I assume the difficult bit will be to find a way to remove each of these modules from source in order to see the effect on compilation (as you suggested in a comment below). Removing from source code (e.g. with regex) can be trickier than finding them. Because finding them usually involves reading the %INC and I am not sure whether removing from %INC will have any effect at all. One thing that comes to my mind, totally untested, is: instead of removing a module from source code and run, just prepend a dir in @INC which will contain "fake" module files (with empty content, bar the boilerplate). For example:
1 minute edit: I think choroba mentioned a similar technique for mocking modules and probably this is where I got it from bw, bliako
In Section
Seekers of Perl Wisdom
|
|