in reply to Re^2: Getting the dependencies list of the module .
in thread Getting the dependencies list of the module .

You do not want Module::Depends, it relies on reading META.yml, or if you use Module::Depends::Intrusive , on running Build.PL/Makefile.PL

$ gtree Module-Depends-0.15 Module-Depends-0.15 |-- Build.PL |-- Changes |-- MANIFEST |-- MANIFEST.SKIP |-- META.yml |-- Makefile.PL |-- NINJA |-- README |-- lib | `-- Module | |-- Depends | | `-- Intrusive.pm | `-- Depends.pm `-- t |-- build_version | `-- Build.PL |-- depends.t |-- empty |-- inline-makemaker | `-- Makefile.PL |-- makemaker-false | `-- Makefile.PL |-- mmish | `-- Makefile.PL |-- module-install | `-- Makefile.PL |-- old | |-- Build.PL | |-- META.yml | `-- Makefile.PL |-- template-extract | |-- Build.PL | |-- META.yml | `-- Makefile.PL |-- uses-findbin | `-- Makefile.PL `-- with-yaml `-- META.yml 14 directories, 24 files $ cd Module-Depends-0.15 $ perl Makefile.PL && dmake test Checking if your kit is complete... Looks good Writing Makefile for Module::Depends dmake: Warning: -- Target [blibdirs] was made but the time stamp has +not been updated. dmake: Warning: -- Target [config] was made but the time stamp has no +t been updated. cp lib/Module/Depends.pm blib\lib\Module\Depends.pm cp lib/Module/Depends/Intrusive.pm blib\lib\Module\Depends\Intrusive.p +m dmake: Warning: -- Target [dynamic] was made but the time stamp has n +ot been updated. dmake: Warning: -- Target [pure_all] was made but the time stamp has +not been updated. C:\perl\5.12.2\bin\MSWin32-x86-multi-thread\perl.exe "-MExtUtils::Comm +and::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/depends.t .. 1/19 Subroutine main::build_requires redefined at C:/pe +rl/5.12.2/lib/Exporter.pm line 64. at Makefile.PL line 3 Subroutine main::include_deps redefined at C:/perl/5.12.2/lib/Exporter +.pm line 64. at Makefile.PL line 3 Subroutine main::requires redefined at C:/perl/5.12.2/lib/Exporter.pm +line 64. at Makefile.PL line 3 t/depends.t .. ok All tests successful. Files=1, Tests=19, 1 wallclock secs ( 0.05 usr + 0.02 sys = 0.06 CP +U) Result: PASS $ perl -Mblib use YAML; use Module::Depends; my $deps = Module::Depends->new->dist_dir( '.' )->find_modules; print "Our dependencies:\n", Dump $deps->requires; __END__ Our dependencies: --- Class::Accessor::Chained: 0 File::Spec: 0 Parse::CPAN::Meta: 0 Test::More: 0 $ cat META.yml --- #YAML:1.0 name: Module-Depends version: 0.15 abstract: ~ author: [] license: unknown distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 requires: Class::Accessor::Chained: 0 File::Spec: 0 Parse::CPAN::Meta: 0 Test::More: 0 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.48 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4
You want to use scandeps
$ scandeps lib\Module\Depends.pm 'FileHandle' => '2.02', 'Scalar::Util' => '1.23', 'UNIVERSAL' => '1.06', 'threads' => '1.82', 'utf8' => '1.08', 'overload' => '1.10', 'Sub::Name' => '0.05', 'Class::Accessor' => '0.34', 'File::Spec::Win32' => '3.33', 'File::Spec' => '3.33', 'Win32' => '0.44', 'DynaLoader' => '1.10', 'XSLoader' => '0.10', 'AutoLoader' => '5.71', 'Config' => 'undef', 'Exporter::Heavy' => '5.64_01', 'File::Spec::Unix' => '3.33', 'Win32API::File' => '0.1101', 'Class::Struct' => '0.63', 'filetest' => '1.02', 'File::stat' => '1.02', 'Tie::Hash' => '1.03', 'IO::Seekable' => '1.10', 'SelectSaver' => '1.02', 'IO::Handle' => '1.28', 'Symbol' => '1.07', 'IO' => '1.25_02', 'IO::Dir' => '1.07', 'IO::Pipe' => '1.13', 'IO::Socket' => '1.31', 'IO::Select' => '1.17', 'IO::Socket::INET' => '1.31', 'Errno' => '1.11', 'IO::Socket::UNIX' => '1.23', 'Socket' => '1.87', 'List::Util::PP' => '1.23', 'Math::BigFloat::Trace' => '0.01', 'Math::BigFloat' => '1.993', 'constant' => '1.20', 'Class::Accessor::Chained' => '0.01', 'Parse::CPAN::Meta' => '1.4401', 'base' => '2.15', 'Cwd' => '3.33', 'strict' => '1.04', 'CPAN::Meta::YAML' => '0.003', 'Exporter' => '5.64_01', 'Carp' => '1.17', 'List::Util' => '1.23', 'Scalar::Util::PP' => '1.23', 'B' => '1.23', 'Tie::StdHandle' => '4.2', 'Fcntl' => '1.06', 'IO::File' => '1.14', 'Math::BigInt::Trace' => '0.01', 'Math::BigInt::FastCalc' => '0.28', 'Math::BigInt::CalcEmu' => '1.993', 'integer' => '1.00', 'Math::BigInt' => '1.993', 'Math::BigInt::Calc' => '1.993', 'Tie::Handle' => '4.2', 'vars' => '1.01', 'mro' => '1.02', 'warnings' => '1.09', 'warnings::register' => '1.01',
or you want to use Devel::Modlist
$ perl -d:Modlist lib\Module\Depends.pm AutoLoader 5.71 Carp 1.17 Class::Accessor 0.34 Class::Accessor::Chained 0.01 Config Config_git.pl Config_heavy.pl Cwd 3.33 DynaLoader 1.10 Exporter 5.64_01 Parse::CPAN::Meta 1.4401 Sub::Name 0.05 XSLoader 0.10 base 2.15 utf8 1.08 vars 1.01 warnings 1.09 warnings::register 1.01

or you want to hack with grep

$ grep -rih use Module-Depends-0.15\lib use strict; use base qw( Module::Depends ); use Cwd qw( getcwd ); use ExtUtils::MakeMaker (); # Just like Module::Depends, only use the Intrusive class instead use strict; use Parse::CPAN::Meta; use Cwd qw( getcwd ); use base qw( Class::Accessor::Chained ); use YAML; use Module::Depends; $ grep -rih use Module-Depends-0.15\lib | perl -lne "print $1 if /use\ +s+([^()\s;]+)/" strict base Cwd ExtUtils::MakeMaker the strict Parse::CPAN::Meta Cwd base YAML Module::Depends

or you want to hack with ack

$ ack --perl -oh "^\s*use\s+\K([^()\s;]+)" Module-Depends-0.15/lib strict base Cwd ExtUtils::MakeMaker strict Parse::CPAN::Meta Cwd base YAML Module::Depends
Or you want to push a coderef onto @INC
$ perl -e " BEGIN { unshift @INC => sub { my $Pm =$_[1]; my($Pack,$Fil +e )=caller; print qq!$Pm\n! if $File eq $ARGV[0]; return; }; } do $ +ARGV[0]" Module-Depends-0.15\lib\Module\Depends.pm | perl -p +e " s/\.pm$//; s!/!::!g; " strict Parse::CPAN::Meta Cwd base
Or PPI based Module::Used/modules-used
$ modules-used Module-Depends-0.15\lib\Module\Depends.pm base Class::Accessor::Chained Cwd Parse::CPAN::Meta strict
Yup, it seems you asked for modules-used