1CPAN::FindDependencies(U3s)er Contributed Perl DocumentatCiPoAnN::FindDependencies(3)
2
3
4
6 CPAN::FindDependencies - find dependencies for modules on the CPAN
7
9 use CPAN::FindDependencies;
10 my @dependencies = CPAN::FindDependencies::finddeps("CPAN");
11 foreach my $dep (@dependencies) {
12 print ' ' x $dep->depth();
13 print $dep->name().' ('.$dep->distribution().")\n";
14 }
15
17 The module uses the CPAN packages index to map modules to distributions
18 and vice versa, and then fetches distributions' META.yml or Makefile.PL
19 files from "http://metacpan.org/" to determine pre-requisites. This
20 means that a working interwebnet connection is required.
21
23 There is just one function, which is not exported by default although
24 you can make that happen in the usual fashion.
25
26 finddeps
27 Takes a single compulsory parameter, the name of a module (ie
28 Some::Module); and the following optional named parameters:
29
30 nowarnings
31 Warnings about modules where we can't find their META.yml or
32 Makefile.PL, and so can't divine their pre-requisites, will be
33 suppressed;
34
35 fatalerrors
36 Failure to get a module's dependencies will be a fatal error
37 instead of merely emitting a warning;
38
39 perl
40 Use this version of perl to figure out what's in core. If not
41 specified, it defaults to 5.005. Three part version numbers (eg
42 5.8.8) are supported but discouraged.
43
44 02packages
45 The location of CPAN.pm's "02packages.details.txt.gz" file as a
46 local filename, with either a relative or an absolute path. If not
47 specified, it is fetched from a CPAN mirror instead. The file is
48 fetched just once.
49
50 cachedir
51 A directory to use for caching. It defaults to no caching. Even
52 if caching is turned on, this is only for META.yml or Makefile.PL
53 files. 02packages is not cached - if you want to read that from a
54 local disk, see the "02packages" option.
55
56 maxdepth
57 Cuts off the dependency tree at the specified depth. Your
58 specified module is at depth 0, your dependencies at depth 1, their
59 dependencies at depth 2, and so on.
60
61 usemakefilepl
62 If set to true, then for any module that doesn't have a META.yml,
63 try to use its Makefile.PL as well. Note that this involves
64 downloading code from the Internet and running it. This obviously
65 opens you up to all kinds of bad juju, hence why it is disabled by
66 default.
67
68 recommended
69 Adds recommended modules to the list of dependencies, if set to a
70 true value.
71
72 It returns a list of CPAN::FindDependencies::Dependency objects, whose
73 useful methods are:
74
75 name
76 The module's name;
77
78 distribution
79 The distribution containing this module;
80
81 version
82 The minimum required version of his module (if specified in the
83 requirer's pre-requisites list);
84
85 depth
86 How deep in the dependency tree this module is;
87
88 warning
89 If any warning was generated (even if suppressed) for the module,
90 it will be recorded here.
91
92 Any modules listed as dependencies but which are in the perl core
93 distribution for the version of perl you specified are suppressed.
94
95 These objects are returned in a semi-defined order. You can be sure
96 that a module will be immediately followed by one of its dependencies,
97 then that dependency's dependencies, and so on, followed by the 'root'
98 module's next dependency, and so on. You can reconstruct the tree by
99 paying attention to the depth of each object.
100
101 The ordering of any particular module's immediate 'children' can be
102 assumed to be random - it's actually hash key order.
103
105 If you set "usemakefilepl" to a true value, this module may download
106 code from the internet and execute it. You should think carefully
107 before enabling that feature.
108
110 You must have web access to <http://metacpan.org/> and (unless you tell
111 it where else to look for the index) <http://www.cpan.org/>, or have
112 all the data cached locally.. If any META.yml or Makefile.PL files are
113 missing, the distribution's dependencies will not be found and a
114 warning will be spat out.
115
116 Startup can be slow, especially if it needs to fetch the index from the
117 interweb.
118
120 I welcome feedback about my code, including constructive criticism and
121 bug reports. The best bug reports include files that I can add to the
122 test suite, which fail with the current code in my git repo and will
123 pass once I've fixed the bug
124
125 Feature requests are far more likely to get implemented if you submit a
126 patch yourself.
127
129 <git://github.com/DrHyde/perl-modules-CPAN-FindDependencies.git>
130
132 CPAN
133
134 <http://deps.cpantesters.org/>
135
136 <http://metacpan.org>
137
139 Copyright 2007 - 2015 David Cantrell <david@cantrell.org.uk>
140
141 This software is free-as-in-speech software, and may be used,
142 distributed, and modified under the terms of either the GNU General
143 Public Licence version 2 or the Artistic Licence. It's up to you which
144 one you use. The full text of the licences can be found in the files
145 GPL2.txt and ARTISTIC.txt, respectively.
146
148 Stephan Loyd (for fixing problems with some META.yml files)
149
150 Alexandr Ciornii (for a patch to stop it segfaulting on Windows)
151
152 Brian Phillips (for the code to report on required versions of modules)
153
154 Ian Tegebo (for the code to extract deps from Makefile.PL)
155
156 Georg Oechsler (for the code to also list 'recommended' modules)
157
158 Jonathan Stowe (for making it work through HTTP proxies)
159
161 This module is also free-as-in-mason software.
162
163
164
165perl v5.28.0 2018-05-23 CPAN::FindDependencies(3)