The Perl 5 module Module::ScanDeps allows to recursively scan Perl code for dependencies.