cpan-adhoc - Get arbitrary information from a CPAN mirror.
$ cpan-adhoc cpan-adhoc> help cpan-adhoc> module LWP::UserAgent cpan-adhoc> list cpan-adhoc> perldoc lib/LWP/UserAgent.pm cpan-adhoc> exit $ cpan-adhoc http://cpan.pair.com/ cpan-adhoc> ... $ cpan-adhoc -help $ cpan-adhoc -version
This option displays the documentation for this script. The script then exits.
If asserted, this option causes the banner to be printed and commands echoed when not reading commands from a terminal.
This option displays the version of this script. The script then exits.
This Perl script implements an interactive query of a CPAN mirror. The default is whatever mirror your CPAN client is set to, as determined by CPAN::Access::AdHoc. You can specify a different mirror on the command line, or using the cpan command.
The following commands are supported:
cpan-adhoc> alias libwww-perl libwww cpan-adhoc> alias libwww
This command creates an alias for a distribution in the downloaded distribution stash. It is simply a convenience to save typing if you have a long distribution name you will be repeatedly typing. The first argument is the name of a distribution, and the second is the alias.
The single-argument version creates an alias for the current distribution, if any.
cpan-adhoc> author cpan-adhoc> author adamk rjbs bingos
This command lists items from the author index authors/01mailrc.txt.gz. If no names are given the whole index is listed in ASCIIbetical order.
This command displays the base directories for the named distributions. If no distribution is specified, the current distribution, if any, is displayed.
This command lists the distribution names encountered since the most-recent clear, or since the script started. Each distribution may appear under multiple names.
clear
cpan-adhoc> cd fu/bar cpan-adhoc> cd
This command changes the default directory under which the script runs. Without an argument, it changes to the user's home directory.
cpan-adhoc> checksums MENUHIN cpan-adhoc> checksums MENUHIN/Yehudi-0.01.tar.gz
This command displays the checksums for the given author or distribution.
cpan-adhoc> choose libwww-perl
This command makes the given downloaded distribution the default.
cpan-adhoc> clear
This command removes all distributions from the stash, and purges cached data from the CPAN::Access::AdHoc object.
cpan-adhoc> corpus BACH
This command lists all distributions in the index for the given CPAN ID. More than one CPAN ID can be specified. The CPAN ID is converted to upper case before use, so the example could equally well be written
cpan-adhoc> corpus bach
Supported options are:
If asserted, development releases are listed; if not asserted they are not. This option is ignored unless -full or -latest is in effect. The default is -development if -production is not asserted.
-full
-latest
-development
-production
If asserted, you get full distribution names. If not asserted, you get the base distribution name only. The default is -nofull.
-nofull
If asserted, you get the full display, but only the highest-numbered version of any distribution is displayed.
If asserted, production releases are listed; if not asserted they are not. This option is ignored unless -full or -latest is in effect. The default is -production if -development is not asserted.
This is just a synonym for -full.
cpan-adhoc> cpan cpan-adhoc> cpan file:///home/yehudi/Mini-CPAN/ cpan-adhoc> cpan -default
If no argument is specified, this command displays the CPAN URL being used.
If an argument is specified, this command sets the CPAN URL being used.
If the CPAN URL was specified as -default, a default value is computed from the current setting of default_cpan_source, and that value is both set as the current soure and displayed. If no default can be computed from the current default_cpan_source, an error is displayed and the current setting is left unchanged.
-default
default_cpan_source
cpan-adhoc> default_cpan_source cpan-adhoc> default_cpan_source cpanm,CPAN cpan-adhoc> default_cpan_source -default
If no argument is specified, this command displays the sources of default CPAN URLs being used.
If an argument is specified, this command sets the sources of default CPAN URLs. The value is a comma-delimited list.
If the argument was specified as -default, the default value is reinstated.
Note that setting this value does not affect the cpan setting. If you want to recompute the cpan URL after setting this, you must do
cpan
cpan-adhoc> cpan -default
The default is 'CPAN::Mini,cpanm,CPAN,CPANPLUS'.
'CPAN::Mini,cpanm,CPAN,CPANPLUS'
cpan-adhoc> diff libwww-perl README README cpan-adhoc> diff README README cpan-adhoc> diff README cpan-adhoc> diff -less -u README README
This command runs diff on a file from a CPAN archive and a local file. The arguments are the distribution name, the file in the distribution, and the local file. The distribution defaults to the current distribution, and the file in the distribution defaults to the local file.
The -less option specifies that the output of diff be viewed in less. Anything else that looks like an option (that is, that has a leading dash) will be passed to the diff program. Because of the possibility of conflict with diff options, -less may not be abbreviated, though it may be specified as --less, or negated -noless.
-less
--less
-noless
The null option (--) ends option processing, and causes anything after it to be considered an argument. For example, in
--
cpan-adhoc> diff README -readme
the trailing -readme is taken as an option for diff. But in
-readme
cpan-adhoc> diff -- README -readme
the trailing -readme is taken as a file name.
This is a synonym for distribution, for convenience.
cpan-adhoc> distribution libwww-perl
This command looks up the given distributions in the module index (sic), using an unanchored regular expression, and displays any matches.
cpan-adhoc> exit
This command causes the script to exit. An end-of-file also works.
cpan-adhoc> extract libwww-perl cpan-adhoc> extract
This command extracts the files in the given distributions into subdirectories of the current directory. If no distribution is specified, the current distribution is extracted.
cpan-adhoc> help
This command displays the documentation for this script.
cpan-adhoc> info libwww-perl cpan-adhoc> info
This command displays the archive name and CPAN ID of the given distributions. If no distribution is specified, the current distribution is displayed.
cpan-adhoc> less libwww-perl lib/LWP/UserAgent.pm cpan-adhoc> less libwww-perl LWP::UserAgent cpan-adhoc> less lib/LWP/UserAgent.pm cpan-adhoc> less LWP::UserAgent
This command feeds the specified file from the specified distribution to whatever pager was configured when Perl was built. If the file is not found, it is assumed to be a module name, and an attempt is made to find that module's file.
The single-argument form attempts to look up the argument in the module index. If it is found, that module's file is displayed. Otherwise it displays the given file in the current distribution, if any
cpan-adhoc> list libwww-perl cpan-adhoc> list
This command lists the files in the given distributions. If no distribution is specified, the current distribution is listed.
This command displays the metadata for the given distributions. If metadata is not available (i.e. no META.json or META.yml was found) a warning will be issued.
The metadata is displayed by the CPAN::Meta as_string() method.
as_string()
cpan-adhoc> module LWP::UserAgent
This command looks up the given modules in the module index, and displays their version and the distribution they are contained in.
cpan-adhoc> perldoc libwww-perl-6.03 lib/LWP/UserAgent.pm cpan-adhoc> perldoc Libwww-perl LWP::UserAgent cpan-adhoc> perldoc lib/LWP/UserAgent.pm cpan-adhoc> perldoc LWP::UserAgent
This command feeds the specified file from the specified distribution to perldoc. If the file is not found, it is assumed to be a module name, and an attempt is made to find that module's file.
The single-argument form attempts to look up the argument in the module index. If it is found, that module's documentation is displayed. Otherwise it displays the given file in the current distribution, if any
This command displays the current default directory.
cpan-adhoc> write libwww-perl cpan-adhoc> write
This command writes the archive of the given distributions into the current directory. If no distribution is specified, the current distribution is written.
Thomas R. Wyant, III wyant at cpan dot org
Copyright (C) 2012-2014 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install CPAN::Access::AdHoc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Access::AdHoc
CPAN shell
perl -MCPAN -e shell install CPAN::Access::AdHoc
For more information on module installation, please visit the detailed CPAN module installation guide.