Lines Matching full:cpan

4 package CPAN;  package
5 $CPAN::VERSION = '2.36';
6 $CPAN::VERSION =~ s/_//;
19 use CPAN::Author;
20 use CPAN::HandleConfig;
21 use CPAN::Version;
22 use CPAN::Bundle;
23 use CPAN::CacheMgr;
24 use CPAN::Complete;
25 use CPAN::Debug;
26 use CPAN::Distribution;
27 use CPAN::Distrostatus;
28 use CPAN::FTP;
29 use CPAN::Index 1.93; # https://rt.cpan.org/Ticket/Display.html?id=43349
30 use CPAN::InfoObj;
31 use CPAN::Module;
32 use CPAN::Prompt;
33 use CPAN::URL;
34 use CPAN::Queue;
35 use CPAN::Tarzip;
36 use CPAN::DeferredCode;
37 use CPAN::Shell;
38 use CPAN::LWP::UserAgent;
39 use CPAN::Exception::RecursiveDependency;
40 use CPAN::Exception::yaml_not_installed;
41 use CPAN::Exception::yaml_process_error;
74 # warn "# Note: Recursive call of CPAN.pm detected\n";
75 my $w = sprintf "# Note: CPAN.pm is running in process %d now", pop @rec;
102 $ENV{PERL5_CPANPLUS_IS_RUNNING}=$$; # https://rt.cpan.org/Ticket/Display.html?id=23735
104 END { $CPAN::End++; &cleanup; }
106 $CPAN::Signal ||= 0;
107 $CPAN::Frontend ||= "CPAN::Shell";
108 unless (@CPAN::Defaultsites) {
109 @CPAN::Defaultsites = map {
110 CPAN::URL->new(TEXT => $_, FROM => "DEF")
112 "http://www.perl.org/CPAN/",
113 "ftp://ftp.perl.org/pub/CPAN/";
115 # $CPAN::iCwd (i for initial)
116 $CPAN::iCwd ||= CPAN::anycwd();
117 $CPAN::Perl ||= CPAN::find_perl();
118 $CPAN::Defaultdocs ||= "http://search.cpan.org/perldoc?";
119 $CPAN::Defaultrecent ||= "http://search.cpan.org/uploads.rdf";
120 $CPAN::Defaultrecent ||= "http://cpan.uwinnipeg.ca/htdocs/cpan.xml";
148 @CPAN::ISA = qw(CPAN::Debug Exporter);
150 # note that these functions live in CPAN::Shell and get executed via
183 #-> sub CPAN::AUTOLOAD ;
188 if ($CPAN::Signal) {
201 CPAN::HandleConfig->load unless $CPAN::Config_loaded++;
203 CPAN::Shell->$l(@_);
205 die(qq{Unknown CPAN command "$AUTOLOAD". }.
258 #-> sub CPAN::shell ;
262 CPAN::HandleConfig->load unless $CPAN::Config_loaded++;
264 my $oprompt = shift || CPAN::Prompt->new;
267 $CPAN::CurrentCommandId ||= 1;
276 $term = Term::ReadLine->new('CPAN Monitor');
281 &CPAN::Complete::gnu_cpl;
285 $readline::rl_completion_function = 'CPAN::Complete::cpl';
287 if (my $histfile = $CPAN::Config->{'histfile'}) {{
289 $CPAN::Frontend->mywarn("Terminal does not support AddHistory.\n");
290 unless ($CPAN::META->has_inst('Term::ReadLine::Perl')) {
291 … $CPAN::Frontend->mywarn("\nTo fix that, maybe try> install Term::ReadLine::Perl\n\n");
297 for ($CPAN::Config->{term_ornaments}) { # alias
311 CPAN::anycwd(),
316 unless ($CPAN::Config->{inhibit_startup_message}) {
319 "available (maybe install Bundle::CPAN or Bundle::CPANxxl?)";
320 $CPAN::Frontend->myprint(
322 cpan shell -- CPAN exploration and modules installation (v%s)
326 $CPAN::VERSION,
361 CPAN::Eval; # hide from the indexer
364 CPAN->import(':DEFAULT') unless $import_done++;
365 CPAN->debug("eval[$eval]") if $CPAN::DEBUG;
376 $CPAN::META->debug("line[".join("|",@line)."]") if $CPAN::DEBUG;
381 CPAN::Shell->$command(@line)
388 if (ref $err and $err->isa('CPAN::Exception::blocked_urllist')) {
389 … $CPAN::Frontend->mywarn("Client not fully configured, please proceed with configuring.$err");
419 eval {CPAN::Shell->failed($CPAN::CurrentCommandId,1);};
427 $CPAN::Frontend->myprint("\n");
429 $CPAN::CurrentCommandId++;
437 CPAN::Queue->nullify_queue;
439 if ($CPAN::META->has_inst("Term::ReadLine::Gnu")
441 $CPAN::META->has_inst("Term::ReadLine::Perl")
445 local($SIG{__WARN__}) = CPAN::Shell::paintdots_onreload(\$redef);
447 $CPAN::Frontend->myprint("\n$redef subroutines in ".
453 for ($CPAN::Config->{term_ornaments}) { # alias
469 for my $dm (sort keys %{$CPAN::META->{readwrite}{"CPAN::$class"}}) {
470 next unless $CPAN::META->{readwrite}{"CPAN::$class"}{$dm}{incommandcolor};
471 CPAN->debug("BUG: $class '$dm' was in command state, resetting");
472 delete $CPAN::META->{readwrite}{"CPAN::$class"}{$dm}{incommandcolor};
477 $META->savehist if $CPAN::term && $CPAN::term->can("GetHistory");
485 #-> CPAN::soft_chdir_with_alternatives ;
490 $CPAN::Frontend->mywarn(qq{Warning: no good directory to chdir to!
500 $CPAN::Frontend->mywarn(qq{Could not chdir to "$cwd->[0]": $!
505 $CPAN::Frontend->mydie(qq{Could not chdir to "$cwd->[0]": $!});
516 …$CPAN::Frontend->mywarn("Your OS does not seem to support locking; continuing and ignoring all loc…
517 $CPAN::Frontend->mysleep(5);
525 my $yaml_module = $CPAN::Config->{yaml_module} || "YAML";
529 !$CPAN::META->has_inst($yaml_module)
531 # $CPAN::Frontend->mywarn("'$yaml_module' not installed, falling back to 'YAML'\n");
536 $CPAN::META->has_inst($yaml_module)
542 … $CPAN::Frontend->mywarn("Warning: YAML version '$YAML::VERSION' is too low, please upgrade!\n".
545 $CPAN::Frontend->mysleep(5);
550 # CPAN::_yaml_loadfile
554 my $opt_loadblessed = $opt->{loadblessed} || $CPAN::Config->{yaml_load_code} || 0;
556 if ($CPAN::META->has_inst($yaml_module)) {
563 ${ "$yaml_module\::LoadCode" } = $CPAN::Config->{yaml_load_code} || 0;
571 die CPAN::Exception::yaml_process_error->new($yaml_module,$local_file,"parse",$@);
581 … die CPAN::Exception::yaml_process_error->new($yaml_module,$local_file,"parse",$@);
584 $CPAN::Frontend->mywarn("Could not open '$local_file': $!");
592 die CPAN::Exception::yaml_not_installed->new($yaml_module, $local_file, "parse");
597 # CPAN::_yaml_dumpfile
601 if ($CPAN::META->has_inst($yaml_module)) {
614 die CPAN::Exception::yaml_process_error->new($yaml_module,$local_file,"dump",$@);
620 die CPAN::Exception::yaml_not_installed->new($yaml_module, $local_file, "dump");
626 unless ($CPAN::META->has_inst("CPAN::SQLite")) {
627 $CPAN::Frontend->mywarn(qq{CPAN::SQLite not installed, trying to work without\n})
628 unless $Have_warned->{"CPAN::SQLite"}++;
631 require CPAN::SQLite::META; # not needed since CVS version of 2006-12-17
632 $CPAN::SQLite ||= CPAN::SQLite::META->new($CPAN::META);
644 my $ret = $CPAN::Config->{use_sqlite} && ($CPAN::SQLite || _init_sqlite());
651 $META ||= CPAN->new; # In case we re-eval ourselves we need the ||
663 my $mtime_perl = (-f CPAN::find_perl ? (stat(_))[9] : '-1');
665 '$^X' => CPAN::find_perl,
685 SUGGEST_MYCONFIG: if(!$INC{'CPAN/MyConfig.pm'}) {
686 $CPAN::Frontend->myprint("You don't seem to have a user ".
688 my $new = CPAN::Shell::colorable_makemaker_prompt("Do you want to create a ".
692 CPAN::Shell->mkmyconfig();
695 $CPAN::Frontend->mydie("OK, giving up.");
700 #-> sub CPAN::all_objects ;
703 CPAN::HandleConfig->load unless $CPAN::Config_loaded++;
704 CPAN->debug("mgr[$mgr] class[$class]") if $CPAN::DEBUG;
705 CPAN::Index->reload;
714 #-> sub CPAN::checklock ;
717 my $lockfile = File::Spec->catfile($CPAN::Config->{cpan_home},".lock");
720 $CPAN::Frontend->mydie("Could not open lockfile '$lockfile': $!");
735 $CPAN::Frontend->mydie(sprintf("CPAN.pm panic: Lockfile '$lockfile'\n".
740 $CPAN::Frontend->mywarn("Running in downgraded mode (experimental)\n");
743 $CPAN::Frontend->mywarn(
745 There seems to be running another CPAN process (pid $otherpid). Contacting...
748 $CPAN::Frontend->mywarn(qq{Other job is running.\n});
752 CPAN::Shell::colorable_makemaker_prompt
755 $CPAN::Frontend->myexit("Ok, bye\n")
767 $CPAN::Frontend->mywarn(
769 There seems to be running another CPAN process according to '$lockfile'.
773 $CPAN::Frontend->mydie(sprintf("CPAN.pm panic: Found invalid lockfile ".
778 CPAN::Shell::colorable_makemaker_prompt
782 $CPAN::Frontend->mywarn("Running in downgraded mode (experimental).
785 for ($CPAN::Config) {
803 $CPAN::Frontend->mydie("\n$msg");
807 my $dotcpan = $CPAN::Config->{cpan_home};
821 $CPAN::Frontend->mywarn(qq{
829 CPAN.pm working directory. I could not create this directory due
838 $CPAN::Frontend->mywarn($mess);
852 $CPAN::Frontend->mywarn(qq{
854 Your configuration suggests that CPAN.pm should use a working
856 $CPAN::Config->{cpan_home}
862 \$CPAN::Config->{cpan_home}
864 this variable in either a CPAN/MyConfig.pm or a CPAN/Config.pm in your
870 while (!CPAN::_flock($fh, LOCK_EX|LOCK_NB)) {
873 $CPAN::Frontend->mydie("Could not lock '$lockfile' with flock: $err; giving up\n");
875 $CPAN::Frontend->mysleep($sleep+=0.1);
876 $CPAN::Frontend->mywarn("Could not lock '$lockfile' with flock: $err; retrying\n");
890 $CPAN::Frontend->mydie("Got SIG$sig, leaving");
897 $CPAN::Frontend->mydie("Got another SIG$sig") if $Signal;
898 $CPAN::Frontend->mywarn("Caught SIG$sig, trying to continue\n");
924 $self->debug("Signal handler set.") if $CPAN::DEBUG;
927 #-> sub CPAN::DESTROY ;
932 #-> sub CPAN::anycwd ;
935 $getcwd = $CPAN::Config->{'getcwd'} || 'cwd';
936 CPAN->$getcwd();
939 #-> sub CPAN::cwd ;
942 #-> sub CPAN::getcwd ;
945 #-> sub CPAN::fastcwd ;
948 #-> sub CPAN::getdcwd ;
951 #-> sub CPAN::backtickcwd ;
955 #-> sub CPAN::_perl_is_same
963 #-> sub CPAN::find_perl ;
971 File::Spec->catfile($CPAN::iCwd,$^X),
1001 #-> sub CPAN::exists ;
1004 CPAN::HandleConfig->load unless $CPAN::Config_loaded++;
1005 CPAN::Index->reload;
1008 $id =~ s/:+/::/g if $class eq "CPAN::Module";
1010 if (CPAN::_sqlite_running) {
1012 $CPAN::SQLite->set($class, $id));
1019 #-> sub CPAN::delete ;
1026 #-> sub CPAN::has_usable
1043 'CPAN::Meta' => [
1045 require CPAN::Meta;
1046 unless (CPAN::Version->vge(CPAN::Meta->VERSION, 2.110350)) {
1047 for ("Will not use CPAN::Meta, need version 2.110350\n") {
1048 $CPAN::Frontend->mywarn($_);
1055 'CPAN::Meta::Requirements' => [
1057 if (defined $CPAN::Meta::Requirements::VERSION
1058 … && CPAN::Version->vlt($CPAN::Meta::Requirements::VERSION, "2.120920")
1060 delete $INC{"CPAN/Meta/Requirements.pm"};
1062 require CPAN::Meta::Requirements;
1063 … unless (CPAN::Version->vge(CPAN::Meta::Requirements->VERSION, 2.120920)) {
1064 … for ("Will not use CPAN::Meta::Requirements, need version 2.120920\n") {
1065 $CPAN::Frontend->mywarn($_);
1072 'CPAN::Reporter' => [
1074 if (defined $CPAN::Reporter::VERSION
1075 && CPAN::Version->vlt($CPAN::Reporter::VERSION, "1.2011")
1077 delete $INC{"CPAN/Reporter.pm"};
1079 require CPAN::Reporter;
1080 unless (CPAN::Version->vge(CPAN::Reporter->VERSION, "1.2011")) {
1081 for ("Will not use CPAN::Reporter, need version 1.2011\n") {
1082 $CPAN::Frontend->mywarn($_);
1096 unless (CPAN::Version->vge(URI::URL::->VERSION,0.08)) {
1098 $CPAN::Frontend->mywarn($_);
1106 my $var = $CPAN::Config->{ftp_proxy} || $ENV{ftp_proxy};
1110 $CPAN::Frontend->mywarn($_);
1121 unless (CPAN::Version->vge(IO::Socket::SSL::->VERSION,1.56)) {
1123 $CPAN::Frontend->mywarn($_);
1132 unless (CPAN::Version->vge(Net::SSLeay::->VERSION,1.49)) {
1134 $CPAN::Frontend->mywarn($_);
1143 unless (CPAN::Version->vge(HTTP::Tiny->VERSION, 0.005)) {
1145 $CPAN::Frontend->mywarn($_);
1153 … unless (CPAN::Version->vge(File::HomeDir::->VERSION, 0.52)) {
1155 $CPAN::Frontend->mywarn($_);
1164 … unless (CPAN::Version->vge(Archive::Tar::->VERSION, $demand)) {
1167 $CPAN::Frontend->mywarn($_);
1181 unless (CPAN::Version->vge(File::Temp::->VERSION,0.16)) {
1183 $CPAN::Frontend->mywarn($_);
1208 $CPAN::Frontend = shift if @_;
1209 $CPAN::Frontend;
1220 #-> sub CPAN::has_inst
1223 Carp::croak("CPAN->has_inst() called without an argument")
1225 my %dont = map { $_ => 1 } keys %{$CPAN::META->{dontload_hash}||{}},
1226 keys %{$CPAN::Config->{dontload_hash}||{}},
1227 @{$CPAN::Config->{dontload_list}||[]};
1232 $CPAN::META->{dontload_hash}{$mod}||=1; # unsafe meta access, ok
1257 $CPAN::Shell::reload->{$file} = $mtime;
1260 CPAN::Shell->optprint("load_module","CPAN: $mod loaded ok$v\n");
1261 if ($mod eq "CPAN::WAIT") {
1262 push @CPAN::Shell::ISA, 'CPAN::WAIT';
1266 $CPAN::Frontend->mywarn(qq{
1267 Please, install Net::FTP as soon as possible. CPAN.pm installs it for you
1272 $CPAN::Frontend->mysleep(3);
1275 $CPAN::Frontend->mywarn(qq{CPAN: checksum security checks disabled }.
1278 $CPAN::Frontend->mywarn(qq{
1279 CPAN: checksum security checks disabled because Digest::SHA not installed. label
1283 $CPAN::Frontend->mysleep(2);
1287 my $check_sigs = $CPAN::Config->{check_sigs};
1295 defined $CPAN::Config->{'gpg'}
1297 $CPAN::Config->{'gpg'} =~ /\S/
1300 $CPAN::Frontend->mywarn(qq{
1301 CPAN: Module::Signature security checks disabled because Module::Signature label
1307 $CPAN::Frontend->mysleep(2);
1316 #-> sub CPAN::instance ;
1319 CPAN::Index->reload;
1326 #-> sub CPAN::new ;
1331 #-> sub CPAN::_exit_messages ;
1337 #-> sub CPAN::cleanup ;
1339 # warn "cleanup called with arg[@_] End[$CPAN::End] Signal[$Signal]";
1349 return if $ineval && !$CPAN::End;
1353 $META->{cachemgr} ||= CPAN::CacheMgr->new('atexit');
1358 if ( $CPAN::CONFIG_DIRTY ) {
1359 $CPAN::Frontend->mywarn("Warning: Configuration not saved.\n");
1361 $CPAN::Frontend->myprint("Lockfile removed.\n");
1363 $CPAN::Frontend->myprint($msg);
1367 #-> sub CPAN::readhist
1370 my $histsize = $CPAN::Config->{'histsize'} || 100;
1382 #-> sub CPAN::savehist
1386 unless ($histfile = $CPAN::Config->{'histfile'}) {
1387 $CPAN::Frontend->mywarn("No history written (no histfile specified).\n");
1390 $histsize = $CPAN::Config->{'histsize'} || 100;
1391 if ($CPAN::term) {
1392 unless ($CPAN::term->can("GetHistory")) {
1393 $CPAN::Frontend->mywarn("Terminal does not support GetHistory.\n");
1399 my @h = $CPAN::term->GetHistory;
1402 open $fh, ">$histfile" or $CPAN::Frontend->mydie("Couldn't open >$histfile: $!");
1408 #-> sub CPAN::is_tested
1418 #-> sub CPAN::reset_tested
1425 #-> sub CPAN::is_installed
1442 …$CPAN::Frontend->mywarn("Lost build_dir detected ($foul), giving up all cached test results of cur…
1444 … SEARCH: for my $d (sort { $a->id cmp $b->id } $CPAN::META->all_objects("CPAN::Distribution")) {
1446 $CPAN::Frontend->mywarn(sprintf "Flushing cache for %s\n", $d->pretty_id);
1459 #-> sub CPAN::set_perl5lib
1477 #$CPAN::Frontend->myprint("Prepending @dirs to PERL5LIB.\n");
1483 $CPAN::Frontend->optprint('perl5lib', "Prepending @dirs to PERL5LIB for '$for'\n");
1487 $cp =~ s/^\Q$CPAN::Config->{build_dir}\E/%BUILDDIR%/;
1490 $CPAN::Frontend->optprint('perl5lib', "Prepending @d to PERL5LIB; ".
1491 "%BUILDDIR%=$CPAN::Config->{build_dir} ".
1498 $CPAN::Frontend->optprint('perl5lib', sprintf ("Prepending blib/arch and blib/lib of ".
1514 CPAN - query, download and build perl modules from CPAN sites
1524 cpan
1530 cpan> install Acme::Meta # in the shell
1532 CPAN::Shell->install("Acme::Meta"); # in perl
1536 cpan> install NWCLARK/Acme-Meta-0.02.tar.gz # in the shell
1538 CPAN::Shell->
1543 $mo = CPAN::Shell->expandany($mod);
1544 $mo = CPAN::Shell->expand("Module",$mod); # same thing
1548 $do = CPAN::Shell->expand("Module",$mod)->distribution;
1549 $do = CPAN::Shell->expandany($distro); # same thing
1550 $do = CPAN::Shell->expand("Distribution",
1555 The CPAN module automates or at least simplifies the make and install
1560 These are fetched from one or more mirrored CPAN (Comprehensive
1563 The CPAN module also supports named and versioned
1576 =head2 CPAN::shell([$prompt, $command]) Starting Interactive Mode
1584 cpan
1622 cpan> m Acme::MetaSyntactic
1631 cpan> a BOOK
1635 cpan> d BOOK/Acme-MetaSyntactic-0.99.tar.gz
1640 cpan> m /lorem/
1645 cpan> i /berlin/
1670 slashes), it is processed. If it is a module, CPAN determines the
1696 CPAN checks whether an install is needed and prints
1700 CPAN also keeps track of what it has done within the current session
1715 cpan> notest install Tk
1736 CPAN directory as stored in the CHECKSUMS files distributed on
1737 CPAN. The listing recurses into subdirectories.
1767 value, then CPAN.pm reads the collected YAML files. If the stored
1774 To speed things up in complex installation scenarios, CPAN.pm keeps
1778 diagnostic message when CPAN.pm refuses to do something a second time
1780 something similar. Another situation where CPAN refuses to act is an
1786 cpan> force get Foo
1787 cpan> force make AUTHOR/Bar-3.14.tar.gz
1788 cpan> force test Baz
1789 cpan> force install Acme::Meta
1800 Interactive sessions maintain a lockfile, by default C<~/.cpan/.lock>.
1810 CPAN.pm installs signal handlers for SIGINT and SIGTERM. While you are
1811 in the cpan-shell, it is intended that you can press C<^C> anytime and
1812 return to the cpan-shell prompt. A SIGTERM will cause the cpan-shell
1817 CPAN.pm ignores SIGPIPE. If the user sets C<inactivity_timeout>, a
1824 =head2 CPAN::Shell
1827 the package CPAN::Shell. If you enter the shell command, your
1837 C<$CPAN::Config-E<gt>{cpan_home}/Bundle> directory. The file contains
1838 a list of all modules that are both available from CPAN and currently
1842 again by running C<cpan Bundle::Snapshot_2012_05_21_00>, or installing
1843 C<Bundle::Snapshot_2012_05_21_00> from the CPAN shell.
1850 versions of CPAN.pm
1874 mkmyconfig() writes your own CPAN::MyConfig file into your C<~/.cpan/>
1881 available on CPAN and provides a list of them. If called without
1887 Package namespace installed latest in CPAN file
1888 CPAN 1.94_64 1.9600 ANDK/CPAN-1.9600.tar.gz
1889 CPAN::Reporter 1.1801 1.1902 DAGOLDEN/CPAN-Reporter-1.1902.tar.gz
1898 It suppresses duplicates in the column C<in CPAN file> such that
1905 The C<recent> command downloads a list of recent uploads to CPAN and
1912 probably change in future versions of CPAN.pm, but the general
1926 file produced earlier. CPAN installs the whole Bundle for you, but
1927 when you try to repeat the job on the second architecture, CPAN
1929 invoke CPAN's recompile on the second architecture and you're done.
1932 perl breaks binary compatibility. If one of the modules that CPAN uses
1933 is in turn depending on binary compatibility (so you cannot run CPAN
1934 commands), then you should try the CPAN::Nox module for recovery.
1945 B<*** WARNING: this command downloads and executes software from CPAN to
1950 The C<smoke> command takes the list of recent uploads to CPAN as
1956 probably change in future versions of CPAN.pm, but the general
1967 =head2 The four C<CPAN::*> Classes: Author, Bundle, Module, Distribution
1970 for both users and programmer. CPAN.pm deals with the four
1989 on CPAN in both version 1.23 and 1.23_90, CPAN.pm offers a convenient
1997 distribution file resides on CPAN relative to the authors/id/
2004 CPAN::Module, the second by an object of class CPAN::Distribution.
2009 versions of CPAN.pm
2011 Distribution objects are normally distributions from the CPAN, but
2015 is also allowed for the current directory at the time CPAN.pm was
2017 directly to that directory. This gives the command C<cpan .> an
2018 interesting touch: while the normal mantra of installing a CPAN module
2019 without CPAN.pm is one of
2027 the command C<cpan .> does all of this at once. It figures out which
2030 installation of the module in the current directory, be it a CPAN
2039 by the cpan shell B<only when surrounded by whitespace>. So piping to
2063 CPAN::Plugin::Flurb=dir,/opt/pkgs/flurb/raw,verbose,1
2074 time at run time. While the cpan shell is running, it checks all
2077 method is called with the active CPAN::Distribution object passed in
2082 When the CPAN module is used for the first time, a configuration
2084 result of the dialog is stored in a hash reference C< $CPAN::Config >
2085 in a file CPAN/Config.pm.
2087 Default values defined in the CPAN/Config.pm file can be
2088 overridden in a user specific file: CPAN/MyConfig.pm. Such a file is
2089 best placed in C<$HOME/.cpan/CPAN/MyConfig.pm>, because C<$HOME/.cpan> is
2090 added to the search path of the CPAN module before the use() or
2149 o conf urllist unshift http://cpan.dev.local/CPAN
2159 Saves all config variables to the current config file (CPAN/Config.pm
2160 or CPAN/MyConfig.pm that was loaded at start).
2165 issuing the command C< o conf init > in the CPAN shell. A subset of
2171 The following keys in the hash reference $CPAN::Config are
2178 indexed in the cpan index pointing to a distro
2212 loaded by the CPAN::has_inst() routine
2235 report loading of optional modules used by CPAN.pm
2254 password your password if you CPAN server wants one
2259 and the CPAN::Plugin module)
2278 pushy_https use https to cpan.org when possible, otherwise use http
2279 to cpan.org and issue a warning
2294 test_report email test reports (if CPAN::Reporter is installed)
2297 CPAN::Reporter history)
2299 urllist arrayref to nearby CPAN sites (or equivalent locations)
2305 use_sqlite use CPAN::SQLite for metadata storage (fast and lean)
2306 username your username if you CPAN server wants one
2309 wait_list arrayref to a wait server to try (See CPAN::WAIT)
2311 yaml_load_code enable YAML code deserialisation via CPAN::DeferredCode
2314 You can set and query each of these options interactively in the cpan
2356 =head2 CPAN::anycwd($path): Note on config variable getcwd
2358 CPAN.pm changes the current working directory often and needs to
2393 file://localhost/whatever/ftp/pub/CPAN/
2397 file:///home/ftp/pub/CPAN/
2403 C<file> URLs, CPAN always tries there first. This
2405 owner of a CD-ROM with CPAN contents is: include your local, possibly
2408 o conf urllist push file://localhost/CDROM/CPAN
2410 CPAN.pm will then fetch the index files from one of the CPAN sites
2425 C<yaml_module>) installed, CPAN.pm collects a few statistical data
2436 Since CPAN.pm version 1.88_51 modules declared as C<build_requires> by
2447 C<ask/no>, CPAN.pm asks the user and sets the default accordingly.
2458 C<allow_installing_outdated_dists> compares the C<blib/> directory with the CPAN index.
2488 (B<Note:> This feature has been introduced in CPAN.pm 1.8854)
2490 Distributions on CPAN usually behave according to what we call the
2491 CPAN mantra. Or since the advent of Module::Build we should talk about
2504 The distroprefs system of C<CPAN.pm> addresses this problem by
2525 temporarily override assorted C<CPAN.pm> configuration variables
2537 See the YAML and Data::Dumper files that come with the C<CPAN.pm>
2545 C<CPAN.pm> in the C<prefs_dir> config variable. Try C<o conf init
2546 prefs_dir> in the CPAN shell to set and activate the distroprefs
2553 Filenames can be picked arbitrarily; C<CPAN.pm> always reads
2562 CPAN.pm falls back to using Data::Dumper and Storable and looks for
2671 Temporarily override assorted C<CPAN.pm> configuration variables.
2708 phase of the CPAN mantra. See below under I<Processing Instructions>.
2713 CPAN mantra. See below under I<Processing Instructions>.
2719 targeted at a specific CPAN distribution or installation.
2749 An array of patches on CPAN or on the local disk to be applied in
2756 the CPAN.pm distribution (these examples are not installed by
2759 Note: if the C<applypatch> program is installed and C<CPAN::Config>
2761 then C<CPAN.pm> lets C<applypatch> apply the patch. Both C<makepatch>
2762 and C<applypatch> are available from CPAN in the C<JV/makepatch-*>
2768 Build.PL> phase of the CPAN mantra. See below under I<Processing
2774 of the CPAN mantra. See below under I<Processing Instructions>.
2798 You must install the C<Expect> module to use C<eexpect>. CPAN.pm
2817 For C<mode=deterministic>, the CPAN.pm injects the
2820 For C<mode=anyorder> CPAN.pm answers a question as soon
2837 You must install the C<Expect> module to use C<expect>. CPAN.pm
2857 C<CPAN.pm> comes with a collection of example YAML files. Note that these
2867 available both as methods (C<CPAN::Shell-E<gt>install(...)>) and as
2869 commands, it makes sense to initialize components of CPAN you need, e.g.:
2871 CPAN::HandleConfig->load;
2872 CPAN::Shell::setup_output;
2873 CPAN::Index->reload;
2878 CPAN::Shell. All commands that are available in the CPAN shell are
2879 methods of the class CPAN::Shell. The arguments on the commandline are
2888 CPAN::Shell->notest("install","A","B","C");
2900 C<CPAN::Shell-E<gt>expand("Module",@things)> method. Expand returns a
2901 list of CPAN::Module objects according to the C<@things> arguments
2908 CPAN::Bundle objects for bundles, CPAN::Module objects for modules, and
2909 CPAN::Distribution objects for distributions. Note: it does not expand
2910 to CPAN::Author objects.
2918 perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'
2922 CPAN::Shell->install($mod);
2926 for $mod (CPAN::Shell->expand("Module","/./")) {
2933 # find out which distribution on CPAN contains a module:
2934 print CPAN::Shell->expand("Module","Apache::Constants")->cpan_file
2936 Or if you want to schedule a I<cron> job to watch CPAN, you could list
2939 perl -e 'use CPAN; CPAN::Shell->r;'
2949 # list all modules on my disk that have newer versions on CPAN
2950 for $mod (CPAN::Shell->expand("Module","/./")) {
2953 printf "Module %s is installed as %s, could be updated to %s from CPAN\n",
2960 for $mod (CPAN::Shell->expand("Module","/Apache|LWP|CGI/")) {
2966 $mod = CPAN::Shell->expand("Module","mod_perl");
2969 CPAN::Shell->r;
2977 =item CPAN::Author::as_glimpse()
2981 =item CPAN::Author::as_string()
2985 =item CPAN::Author::email()
2989 =item CPAN::Author::fullname()
2993 =item CPAN::Author::name()
2997 =item CPAN::Bundle::as_glimpse()
3001 =item CPAN::Bundle::as_string()
3005 =item CPAN::Bundle::clean()
3009 =item CPAN::Bundle::contains()
3014 =item CPAN::Bundle::force($method,@args)
3016 Forces CPAN to perform a task that it normally would have refused to
3019 The internals of the object get the needed changes so that CPAN.pm
3024 =item CPAN::Bundle::get()
3028 =item CPAN::Bundle::inst_file()
3031 C<< $CPAN::Config->{cpan_home} >>. Note that this is different from
3032 CPAN::Module::inst_file.
3034 =item CPAN::Bundle::inst_version()
3036 Like CPAN::Bundle::inst_file, but returns the $VERSION
3038 =item CPAN::Bundle::uptodate()
3042 =item CPAN::Bundle::install()
3046 =item CPAN::Bundle::make()
3050 =item CPAN::Bundle::readme()
3054 =item CPAN::Bundle::test()
3058 =item CPAN::Distribution::as_glimpse()
3062 =item CPAN::Distribution::as_string()
3066 =item CPAN::Distribution::author
3068 Returns the CPAN::Author object of the maintainer who uploaded this
3071 =item CPAN::Distribution::pretty_id()
3076 =item CPAN::Distribution::base_id()
3081 =item CPAN::Distribution::clean()
3086 =item CPAN::Distribution::containsmods()
3093 =item CPAN::Distribution::cvs_import()
3102 =item CPAN::Distribution::dir()
3106 =item CPAN::Distribution::force($method,@args)
3108 Forces CPAN to perform a task that it normally would have refused to
3111 The internals of the object get the needed changes so that CPAN.pm
3115 =item CPAN::Distribution::get()
3117 Downloads the distribution from CPAN and unpacks it. Does nothing if
3121 =item CPAN::Distribution::install()
3132 its dependencies, use CPAN::Shell->install.
3136 =item CPAN::Distribution::isa_perl()
3140 CPAN can contain a hint to achieve a return value of true for other
3143 =item CPAN::Distribution::look()
3148 =item CPAN::Distribution::make()
3155 =item CPAN::Distribution::perldoc()
3159 command I<lynx> specified in C<< $CPAN::Config->{lynx} >>. If I<lynx>
3162 in C<< $CPAN::Config->{pager} >>.
3164 =item CPAN::Distribution::prefs()
3177 =item CPAN::Distribution::prereq_pm()
3188 =item CPAN::Distribution::readme()
3191 through the pager specified in C<< $CPAN::Config->{pager} >>.
3193 =item CPAN::Distribution::reports()
3198 =item CPAN::Distribution::read_yaml()
3206 =item CPAN::Distribution::test()
3211 =item CPAN::Distribution::uptodate()
3216 =item CPAN::Index::force_reload()
3220 =item CPAN::Index::reload()
3223 C<< $CPAN::Config->{index_expire} >> days.
3225 =item CPAN::InfoObj::dump()
3227 CPAN::Author, CPAN::Bundle, CPAN::Module, and CPAN::Distribution
3232 =item CPAN::Module::as_glimpse()
3242 =item CPAN::Module::as_string()
3246 =item CPAN::Module::clean()
3250 =item CPAN::Module::cpan_file()
3252 Returns the filename on CPAN that is associated with the module.
3254 =item CPAN::Module::cpan_version()
3256 Returns the latest version of this module available on CPAN.
3258 =item CPAN::Module::cvs_import()
3262 =item CPAN::Module::description()
3265 modules listed in The Module List (CPAN/modules/00modlist.long.html
3268 =item CPAN::Module::distribution()
3270 Returns the CPAN::Distribution object that contains the current
3273 =item CPAN::Module::dslip_status()
3328 =item CPAN::Module::force($method,@args)
3330 Forces CPAN to perform a task it would normally refuse to
3333 The internals of the object get the needed changes so that CPAN.pm
3337 =item CPAN::Module::get()
3341 =item CPAN::Module::inst_file()
3347 =item CPAN::Module::available_file()
3354 =item CPAN::Module::inst_version()
3358 =item CPAN::Module::available_version()
3362 =item CPAN::Module::install()
3366 =item CPAN::Module::look()
3372 =item CPAN::Module::make()
3376 =item CPAN::Module::manpage_headline()
3383 =item CPAN::Module::perldoc()
3387 =item CPAN::Module::readme()
3391 =item CPAN::Module::reports()
3395 =item CPAN::Module::test()
3399 =item CPAN::Module::uptodate()
3403 =item CPAN::Module::userid()
3412 ($CPAN::Config->{build_dir}). It is a simple FIFO mechanism that
3414 all directories there gets bigger than $CPAN::Config->{build_cache}
3417 trusted by CPAN itself. This is due to the fact that the user might
3420 There is another directory ($CPAN::Config->{keep_source_where}) where
3451 Bundles are treated specially in the CPAN package. If you say 'install
3452 Bundle::Tkkit' (assuming such a bundle exists), CPAN will install all
3461 The CPAN program is trying to depend on as little as possible so the
3463 the environment provides. For example if you try in the CPAN shell
3465 install Bundle::CPAN
3473 If you have a local mirror of CPAN and can access all files with
3476 required for non-UNIX systems, or if your nearest CPAN site is
3487 This module presumes that all packages on CPAN
3516 the software producing the indices on CPAN, the mirroring process on CPAN,
3518 within the CPAN.pm module itself.
3520 For debugging the code of CPAN.pm itself in interactive mode, some
3522 CPAN.pm with one of
3546 cpan> and the debugging switches. Add a new debug statement while
3547 running in the shell and then issue a C<reload cpan> and see the new
3554 For debugging of CPAN data there is the C<dump> command which takes
3562 CPAN.pm works nicely without network access, too. If you maintain machines
3565 you might use CPAN.pm to put together all you need on a networked
3566 machine. Then copy the $CPAN::Config->{keep_source_where} (but not
3567 $CPAN::Config->{build_dir}) directory on a floppy. This floppy is kind
3568 of a personal CPAN. CPAN.pm on the non-networked machines works nicely
3578 the running CPAN.pm that are considered optional. The config variable
3584 cpan> o conf dontload_list push YAML
3609 Getter/setter for frontend object. Method just allows to subclass CPAN.pm.
3615 There's no strong security layer in CPAN.pm. CPAN.pm helps you to
3622 Since release 1.77, CPAN.pm has been able to verify cryptographically
3623 signed module distributions using Module::Signature. The CPAN modules
3625 unsigned MD5 checksums that were used before by CPAN protect mainly
3640 Most functions in package CPAN are exported by default. The reason
3641 for this is that the primary use is intended for the cpan shell or for
3646 When the CPAN shell enters a subshell via the look command, it sets
3650 When CPAN runs, it sets the environment variable PERL5_CPAN_IS_RUNNING
3663 connections. The same effect can be achieved by starting the cpan
3672 on the CPAN shell command line. This command writes a bundle definition
3678 cpan> install Bundle::my_bundle
3684 things: dependencies and interactivity. CPAN.pm sometimes fails on
3691 ones later, so you can go out for coffee after a few minutes and leave CPAN.pm
3694 =head1 WORKING WITH CPAN.pm BEHIND FIREWALLS
3772 then you would configure CPAN.pm with the command
3789 I installed a new version of module X but CPAN keeps saying,
3795 CPAN.pm problem, you would have the same problem when installing the
3823 cpan> install Bundle::mybundle
3834 o conf make_arg "| tee -ai /root/.cpan/logs/make.out"
3835 o conf make_install_arg "| tee -ai /root/.cpan/logs/make_install.out"
3844 As of CPAN 1.9463, if you do not have permission to write the default perl
3845 library directories, CPAN's configuration process will ask you whether
3866 The reason for this is that CPAN does not know the dependencies of all
3872 Please note, CPAN.pm does not know the dependency tree in advance and
3883 can I integrate these modules with CPAN.pm but without uploading
3884 the modules to CPAN?
3886 Have a look at the CPAN::Site module.
3890 When I run CPAN's shell, I get an error message about things in my
3903 Internally CPAN.pm uses the UTF-8 charset. If your terminal is
3908 cpan> o conf term_is_latin 1
3911 CPAN.pm at rt.cpan.org and describe your needs. Maybe we can extend
3915 future version of CPAN.pm. It will be replaced with the conventions
3921 condition and retry, CPAN.pm refuses to install the module, saying
3938 By default, CPAN will install the latest non-developer release of a
3943 cpan> install KWILLIAMS/Module-Build-0.27_07.tar.gz
3950 without being prompted for anything, despite my CPAN configuration
3953 CPAN uses ExtUtils::MakeMaker's prompt() function to ask its questions, so
3965 http://search.cpan.org/dist/Module-Build-Convert/
3969 I'm frequently irritated with the CPAN shell's inability to help me
3972 CPAN can now help you select a "good" mirror, based on which ones have the
3974 urllist' and allow CPAN to automatically select mirrors for you.
3982 Henk P. Penning maintains a site that collects data about CPAN sites:
3984 http://mirrors.cpan.org/
4005 Older versions of CPAN.pm had the original root directory of all
4011 CPAN.pm in concurrent processes simultaneously safe.
4021 directory) or exit the CPAN shell, respectively. If you never start up
4022 the CPAN shell, you probably also have to clean up the build directory
4031 and these two CPAN.pm config variables must be reconfigured:
4050 CPAN.pm is regularly tested to run under 5.005 and assorted
4053 impossible to get the whole Bundle::CPAN working there. If you're in
4054 the position to have only these old versions, be advised that CPAN is
4055 designed to work fine without the Bundle::CPAN installed.
4059 prerequisite but CPAN has reasonable workarounds if it is missing.
4064 cooler than the other. CPAN.pm is older. CPANPLUS was designed to be
4065 more modular, but it was never intended to be compatible with CPAN.pm.
4070 cpan shell with a considerably smaller footprint. Very cool stuff.
4081 Please report bugs via L<http://rt.cpan.org/>
4090 Andreas Koenig C<< <andk@cpan.org> >>
4103 L<http://homepage3.nifty.com/hippo2000/perltips/CPAN.htm>
4107 Many people enter the CPAN shell by running the L<cpan> utility
4110 your operating system) then typing C<cpan> in a console window will
4115 work with CPAN.pm: http://community.opscode.com/cookbooks/cpan.