← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:14 2017

Filename/Users/brian/bin/perls/cpan5.26.1
StatementsExecuted 3 statements in 25µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
537643.55ms3.55msUNIVERSAL::::isaUNIVERSAL::isa (xsub)
111377µs377µsmain::::CORE:pack main::CORE:pack (opcode)
76115281µs281µsUNIVERSAL::::canUNIVERSAL::can (xsub)
12911144µs144µsmro::::method_changed_in mro::method_changed_in (xsub)
12911137µs137µsInternals::::SvREADONLYInternals::SvREADONLY (xsub)
0000s0smain::::BEGIN main::BEGIN
0000s0smain::::RUNTIME main::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
01752µsProfile data that couldn't be associated with a specific line:
# spent 752µs making 1 call to CPAN::END
1#!/usr/local/perls/perl-5.26.1/bin/perl
211µs eval 'exec /usr/local/perls/perl-5.26.1/bin/perl -S $0 ${1+"$@"}'
3 if $running_under_some_shell;
4#!/usr/local/bin/perl
5
6BEGIN { pop @INC if $INC[-1] eq '.' }
7use strict;
8use vars qw($VERSION);
9
10use App::Cpan '1.64';
1112µs$VERSION = '1.64';
12
13122µs1119smy $rc = App::Cpan->run( @ARGV );
# spent 119s making 1 call to App::Cpan::run
14
15# will this work under Strawberry Perl?
16exit( $rc || 0 );
17
18=head1 NAME
19
20cpan - easily interact with CPAN from the command line
21
22=head1 SYNOPSIS
23
24 # with arguments and no switches, installs specified modules
25 cpan module_name [ module_name ... ]
26
27 # with switches, installs modules with extra behavior
28 cpan [-cfFimtTw] module_name [ module_name ... ]
29
30 # use local::lib
31 cpan -I module_name [ module_name ... ]
32
33 # one time mirror override for faster mirrors
34 cpan -p ...
35
36 # with just the dot, install from the distribution in the
37 # current directory
38 cpan .
39
40 # without arguments, starts CPAN.pm shell
41 cpan
42
43 # without arguments, but some switches
44 cpan [-ahpruvACDLOPX]
45
46=head1 DESCRIPTION
47
48This script provides a command interface (not a shell) to CPAN. At the
49moment it uses CPAN.pm to do the work, but it is not a one-shot command
50runner for CPAN.pm.
51
52=head2 Options
53
54=over 4
55
56=item -a
57
58Creates a CPAN.pm autobundle with CPAN::Shell->autobundle.
59
60=item -A module [ module ... ]
61
62Shows the primary maintainers for the specified modules.
63
64=item -c module
65
66Runs a `make clean` in the specified module's directories.
67
68=item -C module [ module ... ]
69
70Show the F<Changes> files for the specified modules
71
72=item -D module [ module ... ]
73
74Show the module details. This prints one line for each out-of-date module
75(meaning, modules locally installed but have newer versions on CPAN).
76Each line has three columns: module name, local version, and CPAN
77version.
78
79=item -f
80
81Force the specified action, when it normally would have failed. Use this
82to install a module even if its tests fail. When you use this option,
83-i is not optional for installing a module when you need to force it:
84
85 % cpan -f -i Module::Foo
86
87=item -F
88
89Turn off CPAN.pm's attempts to lock anything. You should be careful with
90this since you might end up with multiple scripts trying to muck in the
91same directory. This isn't so much of a concern if you're loading a special
92config with C<-j>, and that config sets up its own work directories.
93
94=item -g module [ module ... ]
95
96Downloads to the current directory the latest distribution of the module.
97
98=item -G module [ module ... ]
99
100UNIMPLEMENTED
101
102Download to the current directory the latest distribution of the
103modules, unpack each distribution, and create a git repository for each
104distribution.
105
106If you want this feature, check out Yanick Champoux's C<Git::CPAN::Patch>
107distribution.
108
109=item -h
110
111Print a help message and exit. When you specify C<-h>, it ignores all
112of the other options and arguments.
113
114=item -i module [ module ... ]
115
116Install the specified modules. With no other switches, this switch
117is implied.
118
119=item -I
120
121Load C<local::lib> (think like C<-I> for loading lib paths). Too bad
122C<-l> was already taken.
123
124=item -j Config.pm
125
126Load the file that has the CPAN configuration data. This should have the
127same format as the standard F<CPAN/Config.pm> file, which defines
128C<$CPAN::Config> as an anonymous hash.
129
130=item -J
131
132Dump the configuration in the same format that CPAN.pm uses. This is useful
133for checking the configuration as well as using the dump as a starting point
134for a new, custom configuration.
135
136=item -l
137
138List all installed modules with their versions
139
140=item -L author [ author ... ]
141
142List the modules by the specified authors.
143
144=item -m
145
146Make the specified modules.
147
148=item -M mirror1,mirror2,...
149
150A comma-separated list of mirrors to use for just this run. The C<-P>
151option can find them for you automatically.
152
153=item -n
154
155Do a dry run, but don't actually install anything. (unimplemented)
156
157=item -O
158
159Show the out-of-date modules.
160
161=item -p
162
163Ping the configured mirrors and print a report
164
165=item -P
166
167Find the best mirrors you could be using and use them for the current
168session.
169
170=item -r
171
172Recompiles dynamically loaded modules with CPAN::Shell->recompile.
173
174=item -s
175
176Drop in the CPAN.pm shell. This command does this automatically if you don't
177specify any arguments.
178
179=item -t module [ module ... ]
180
181Run a `make test` on the specified modules.
182
183=item -T
184
185Do not test modules. Simply install them.
186
187=item -u
188
189Upgrade all installed modules. Blindly doing this can really break things,
190so keep a backup.
191
192=item -v
193
194Print the script version and CPAN.pm version then exit.
195
196=item -V
197
198Print detailed information about the cpan client.
199
200=item -w
201
202UNIMPLEMENTED
203
204Turn on cpan warnings. This checks various things, like directory permissions,
205and tells you about problems you might have.
206
207=item -x module [ module ... ]
208
209Find close matches to the named modules that you think you might have
210mistyped. This requires the optional installation of Text::Levenshtein or
211Text::Levenshtein::Damerau.
212
213=item -X
214
215Dump all the namespaces to standard output.
216
217=back
218
219=head2 Examples
220
221 # print a help message
222 cpan -h
223
224 # print the version numbers
225 cpan -v
226
227 # create an autobundle
228 cpan -a
229
230 # recompile modules
231 cpan -r
232
233 # upgrade all installed modules
234 cpan -u
235
236 # install modules ( sole -i is optional )
237 cpan -i Netscape::Booksmarks Business::ISBN
238
239 # force install modules ( must use -i )
240 cpan -fi CGI::Minimal URI
241
242 # install modules but without testing them
243 cpan -Ti CGI::Minimal URI
244
245=head2 Environment variables
246
247There are several components in CPAN.pm that use environment variables.
248The build tools, L<ExtUtils::MakeMaker> and L<Module::Build> use some,
249while others matter to the levels above them. Some of these are specified
250by the Perl Toolchain Gang:
251
252Lancaster Concensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md>
253
254Oslo Concensus: L<https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/oslo-consensus.md>
255
256=over 4
257
258=item NONINTERACTIVE_TESTING
259
260Assume no one is paying attention and skips prompts for distributions
261that do that correctly. C<cpan(1)> sets this to C<1> unless it already
262has a value (even if that value is false).
263
264=item PERL_MM_USE_DEFAULT
265
266Use the default answer for a prompted questions. C<cpan(1)> sets this
267to C<1> unless it already has a value (even if that value is false).
268
269=item CPAN_OPTS
270
271As with C<PERL5OPTS>, a string of additional C<cpan(1)> options to
272add to those you specify on the command line.
273
274=item CPANSCRIPT_LOGLEVEL
275
276The log level to use, with either the embedded, minimal logger or
277L<Log::Log4perl> if it is installed. Possible values are the same as
278the C<Log::Log4perl> levels: C<TRACE>, C<DEBUG>, C<INFO>, C<WARN>,
279C<ERROR>, and C<FATAL>. The default is C<INFO>.
280
281=item GIT_COMMAND
282
283The path to the C<git> binary to use for the Git features. The default
284is C</usr/local/bin/git>.
285
286=back
287
288=head1 EXIT VALUES
289
290The script exits with zero if it thinks that everything worked, or a
291positive number if it thinks that something failed. Note, however, that
292in some cases it has to divine a failure by the output of things it does
293not control. For now, the exit codes are vague:
294
295 1 An unknown error
296
297 2 The was an external problem
298
299 4 There was an internal problem with the script
300
301 8 A module failed to install
302
303=head1 TO DO
304
305* one shot configuration values from the command line
306
307=head1 BUGS
308
309* none noted
310
311=head1 SEE ALSO
312
313Most behaviour, including environment variables and configuration,
314comes directly from CPAN.pm.
315
316=head1 SOURCE AVAILABILITY
317
318This code is in Github in the CPAN.pm repository:
319
320 https://github.com/andk/cpanpm
321
322The source used to be tracked separately in another GitHub repo,
323but the canonical source is now in the above repo.
324
325=head1 CREDITS
326
327Japheth Cleaver added the bits to allow a forced install (-f).
328
329Jim Brandt suggest and provided the initial implementation for the
330up-to-date and Changes features.
331
332Adam Kennedy pointed out that exit() causes problems on Windows
333where this script ends up with a .bat extension
334
335=head1 AUTHOR
336
337brian d foy, C<< <[email protected]> >>
338
339=head1 COPYRIGHT
340
341Copyright (c) 2001-2015, brian d foy, All Rights Reserved.
342
343You may redistribute this under the same terms as Perl itself.
344
345=cut
346
3471;
 
# spent 137µs within Internals::SvREADONLY which was called 129 times, avg 1µs/call: # 129 times (137µs+0s) by constant::import at line 164 of constant.pm, avg 1µs/call
sub Internals::SvREADONLY; # xsub
# spent 281µs within UNIVERSAL::can which was called 76 times, avg 4µs/call: # 60 times (187µs+0s) by Archive::Tar::Constant::_list_consts at line 100 of Archive/Tar/Constant.pm, avg 3µs/call # 4 times (19µs+0s) by CPAN::Shell::expand at line 1322 of CPAN/Shell.pm, avg 5µs/call # 3 times (12µs+0s) by CPAN::shell at line 447 of CPAN.pm, avg 4µs/call # 2 times (17µs+0s) by CPAN::FTP::_get_urllist at line 216 of CPAN/FTP.pm, avg 8µs/call # once (14µs+0s) by CPAN::savehist at line 1332 of CPAN.pm # once (8µs+0s) by CPAN::shell at line 305 of CPAN.pm # once (6µs+0s) by CPAN::Shell::rematein at line 1869 of CPAN/Shell.pm # once (6µs+0s) by CPAN::Module::rematein at line 487 of CPAN/Module.pm # once (5µs+0s) by CPAN::shell at line 286 of CPAN.pm # once (4µs+0s) by CPAN::Shell::rematein at line 1876 of CPAN/Shell.pm # once (3µs+0s) by CPAN::Module::rematein at line 488 of CPAN/Module.pm
sub UNIVERSAL::can; # xsub
# spent 3.55ms within UNIVERSAL::isa which was called 537 times, avg 7µs/call: # 500 times (3.45ms+0s) by File::Path::rmtree at line 250 of File/Path.pm, avg 7µs/call # 27 times (72µs+0s) by IO::Compress::Base::Common::isaFilehandle at line 115 of IO/Compress/Base/Common.pm, avg 3µs/call # 5 times (21µs+0s) by File::Path::mkpath at line 94 of File/Path.pm, avg 4µs/call # 3 times (5µs+0s) by IO::Compress::Base::Common::isaFilename at line 129 of IO/Compress/Base/Common.pm, avg 2µs/call # once (3µs+0s) by CPAN::Index::read_metadata_cache at line 577 of CPAN/Index.pm # once (2µs+0s) by Safe::reval at line 358 of Safe.pm
sub UNIVERSAL::isa; # xsub
# spent 377µs within main::CORE:pack which was called: # once (377µs+0s) by IO::Compress::Gzip::BEGIN@15 at line 145 of IO/Compress/Gzip/Constants.pm
sub main::CORE:pack; # opcode
# spent 144µs within mro::method_changed_in which was called 129 times, avg 1µs/call: # 129 times (144µs+0s) by constant::import at line 198 of constant.pm, avg 1µs/call
sub mro::method_changed_in; # xsub