parse Perl code. It tries very hard to find all modules (whether pragmas, Core, or from CPAN) used by the parsed code. WWW: http://search.cpan.org/dist/Module-ExtractUse/