in reply to How do I detect what modules are not being used?

How about running the scripts under the profiler

perl -d:DProf mycode.pl

To find out which modules/subroutines are actually called/used

I know that this may not catch all the edge cases but it might be worth a try ?

Cheers

The Cat

Replies are listed 'Best First'.
Re^2: How do I detect what modules are not being used?
by hakkr (Chaplain) on Apr 07, 2005 at 14:26 UTC
    Hi,

    You could maybe just mess with @INC or programmtically rename each module directory and then perl -c each script and look for the "Undefined subroutine &main:: at line" errors

      hakkr,
      This is similar to the approach I outlined (commenting out each module). This is certainly better than nothing, but there are still plenty of edge cases that would make this less than a 100% solution. For instance, if a module is required inside an eval block of a conditional, then only under the right circumstances will making the module unavailable show up. A comprehensive test suite is needed to ensure removing the module will have no ill effect.

      Cheers - L~R