Content-type: text/html
my $cb = CPANPLUS::Backend->new; my $conf = $cb->configure_object; my $author = $cb->author_tree('KANE'); my $mod = $cb->module_tree('Some::Module'); my $mod = $cb->parse_module( module => 'Some::Module' ); my @objs = $cb->search( type => TYPE, allow => [...] ); $cb->flush('all'); $cb->reload_indices; $cb->local_mirror;
Additionally, the environment variable "PERL5_CPANPLUS_IS_VERSION" will be set to the version of "CPANPLUS::Backend".
This information might be useful somehow to spawned processes.
New will return a "CPANPLUS::Backend" object on success and die on failure.
If you give it any arguments, they will be treated as module names and "module_tree" will try to look up these module names and return the corresponding module objects instead.
See CPANPLUS::Module for the operations you can perform on a module object.
If you give it any arguments, they will be treated as author names and "author_tree" will try to look up these author names and return the corresponding author objects instead.
See CPANPLUS::Module::Author for the operations you can perform on an author object.
See CPANPLUS::Configure for operations you can perform on a configure object.
See the CPANPLUS::Selfupdate manpage for the operations you can perform on the selfupdate object.
You have to specify an array reference of regular expressions or strings to match against. The rules used for this array ref are the same as in "Params::Check", so read that manpage for details.
The search is an "or" search, meaning that if "any" of the criteria match, the search is considered to be successful.
You can specify the result of a previous search as "data" to limit the new search to these module or author objects, rather than the entire module or author tree. This is how you do "and" searches.
Returns a list of module or author objects on success and false on failure.
See CPANPLUS::Module for the operations you can perform on a module object. See CPANPLUS::Module::Author for the operations you can perform on an author object.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
See the equivalent method in "CPANPLUS::Module" for details on other options you can pass.
Since this is a multi-module method call, the return value is implemented as a "CPANPLUS::Backend::RV" object. Please consult that module's documentation on how to interpret the return value.
These items would all come up with a "CPANPLUS::Module" object for "Text::Bastardize". The ones marked explicitly as being version 1.06 would give back a "CPANPLUS::Module" object of that version. Even if the version on CPAN is currently higher.
If "parse_module" is unable to actually find the module you are looking for in its module tree, but you supplied it with an author, module and version part in a distribution name or URI, it will create a fake "CPANPLUS::Module" object for you, that you can use just like the real thing.
See CPANPLUS::Module for the operations you can perform on a module object.
If even this fancy guessing doesn't enable "parse_module" to create a fake module object for you to use, it will warn about an error and return false.
If "update_source" is set to true, this will fetch new source files from your CPAN mirror. Otherwise, "reload_indices" will do its usual cache checking and only update them if they are out of date.
By default, "update_source" will be false.
The verbose setting defaults to what you have specified in your config file.
Returns true on success and false on failure.
The return status of methods which have been attempted, such as different ways of fetching files. It is recommended that automatic flushing be used instead.
The return status of URIs which have been attempted, such as different hosts of fetching files. It is recommended that automatic flushing be used instead.
Information about modules such as prerequisites and whether installation succeeded, failed, or was not attempted.
This resets PERL5LIB, which is changed to ensure that while installing modules they are in our @INC.
This resets the cache of modules we've attempted to load, but failed. This enables you to load them again after a failed load, if they somehow have become available.
Flush all of the aforementioned caches.
Returns true on success and false on failure.
See CPANPLUS::Module for the operations you can perform on a module object.
It takes the following arguments:
Defaults to true.
Defaults to whatever setting you have in your "CPANPLUS::Config".
Defaults to whatever setting you have in your "CPANPLUS::Config".
Returns true on success and false on error.
It will, by default, write to an 'autobundle' directory under your cpanplus homedirectory, but you can override that by supplying a "path" argument.
It will return the location of the output file on success and false on failure.
The methodology behind this works much like "Debian's apt-sources".
The methods below show you how to make use of this functionality. Also note that most of these methods are available through the default shell plugin command "/cs", making them available as shortcuts through the shell and via the commandline.
/full/path/to/local/index => http://remote/source
Note that any file starting with an "#" is being ignored.
Returns the full path to the local index on success, or false on failure.
Note that when adding a new "URI", the change to the in-memory tree is not saved until you rebuild or save the tree to disk again. You can do this using the "$cb->reload_indices" method.
To find out what "URI"s you have as part of your own sources list, use the "$cb->list_custom_sources" method.
Returns the full path to the deleted local index file on success, or false on failure.
Here's an example of how custom sources would resolve into index files:
file:///path/to/sources => file:///path/to/sources/packages.txt http://example.com/sources => http://example.com/sources/packages.txt ftp://example.com/sources => ftp://example.com/sources/packages.txt
The file "packages.txt" simply holds a list of packages that can be found under the root of the "URI". This file can be automatically generated for you when the remote source is a "file:// URI". For "http://", "ftp://", and similar, the administrator of that repository should run the method "$cb->write_custom_source_index" on the repository to allow remote users to index it.
For details, see the "$cb->write_custom_source_index" method below.
All packages that are added via this mechanism will be attributed to the author with "CPANID" "LOCAL". You can use this id to search for all added packages.
The index will be written to a file called "packages.txt" in your repository root, which you can specify with the "path" argument. You can override this location by specifying the "to" argument, but in normal operation, that should not be required.
Once the index file is written, users can then add the "URI" pointing to the repository to their custom list of sources and start using it right away. See the "$cb->add_custom_source" method for user details.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.