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

Unless you can solve the halting problem, you cannot write a program that determines whether a used module is used or not. Note also that (directly) calling subs or methods in the module isn't a good test - modules like Exporter, strict or Memoize would then be classified as "not in use", even if they are.

If you have a good test suite, one approach you could take is to outcomment a use Module; of which you think is not in use, and run the test suite. But that only works if your test suite covers all paths. And, due to the way the modules work, outcommenting use strict; and use Memoize; won't show any failures.

  • Comment on Re: How do I detect what modules are not being used?