CPAN::Access::AdHoc::Util - Utility functions for CPAN::Access::AdHoc
use CPAN::Access::AdHoc::Util; say 'The CPAN default plugins are ', join ', ', CPAN::Access::AdHoc::Util::plugins( 'CPAN::Access::AdHoc::Default::CPAN' );
This module provides utility functions to CPAN::Access::AdHoc. It is private to the CPAN-Access-AdHoc distribution. Documentation is for the benefit of the author only.
CPAN-Access-AdHoc
This module provides the following public subroutines (which are nonetheless private to the CPAN-Access-AdHoc distribution):
This subroutine/method returns the hash element of its argument which is named after the caller's name space. This element is initialized to an empty hash if necessary.
This subroutine takes as its argument a putative distribution path relative to the authors/id/ directory. If it does not begin with the two levels of directory that are derived from the author name, these are added. The expanded path is returned.
__guess_media_type( $resp, $path );
This subroutine guesses the media type and encoding.
The first argument is an HTTP::Response object such as would have been returned by a successful fetch of the data.
The second argument is optional, and is the URL or path used to fetch the data. If the second argument is defined, it sets the Content-Location header in $resp. If $path is not defined, it defaults to $resp->header( 'Content-Location' ), and an exception is thrown if there is none.
Content-Location
$resp
$path
$resp->header( 'Content-Location' )
The method loads the Content-Type and Content-Encoding headers of the $resp object with its best guess at what they are. Nothing is returned.
Content-Type
Content-Encoding
Note that the arguments are reversed from LWP::MediaTypes::guess_media_type().
LWP::MediaTypes::guess_media_type()
This subroutine takes as its arguments one or more module names, and loads them.
This subroutine loads Carp, and then passes its arguments to carp().
carp()
This subroutine loads Carp, and then passes its arguments to croak().
croak()
This subroutine loads Carp, and then passes its arguments to confess(), prefixed by the text 'Programming Error - '.
confess()
'Programming Error - '
Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.
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.