|Problems? Is your data what you think it is?|
What modules are we actually using?by cbrandtbuffalo (Deacon)
|on Apr 27, 2005 at 13:59 UTC||Need Help??|
cbrandtbuffalo has asked for the
wisdom of the Perl Monks concerning the following question:
Is there a standard module or regex out there to search a file system and list all modules that are actually being used?
We're preparing for a perl upgrade, and I want to avoid having to re-install modules that we no longer use. For example, we currently use DCE for authentication/authorization, so we have the DCE module. But we are moving off DCE, so we'll never need that module again.
I started writing a simple script to look for 'use', 'require', 'do', etc. but there are enough permutations that it started to seem non-trivial. There are other tricky bits like DBI and the RootClass option that is like a use, or Class::DBI with the inflate option that can indicate a module to use.
Anyone do this already?
Update: I'm starting to focus my problem based on the comments thus far.
So I'm considering going ahead with what I started which is to work file-by-file and look for all the ways I know of to pull in a module (use, require, etc. see above). I'll create a test file that uses all of them and add test cases as they come up. I think I'll start with Module::Info as suggested below and just add cases to that.