GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CPANPLUS::Internals::Fetch(3) User Contributed Perl Documentation CPANPLUS::Internals::Fetch(3)

CPANPLUS::Internals::Fetch - internals for fetching files

    my $output = $cb->_fetch(
                        module      => $modobj,
                        fetchdir    => '/path/to/save/to',
                        verbose     => BOOL,
                        force       => BOOL,
                    );

    $cb->_add_fail_host( host => 'foo.com' );
    $cb->_host_ok(       host => 'foo.com' );

CPANPLUS::Internals::Fetch fetches files from either ftp, http, file or rsync mirrors.

This is the rough flow:

    $cb->_fetch
        Delegate to File::Fetch;

"_fetch" will fetch files based on the information in a module object. You always need a module object. If you want a fake module object for a one-off fetch, look at "CPANPLUS::Module::Fake".

"fetchdir" is the place to save the file to. Usually this information comes from your configuration, but you can override it expressly if needed.

"fetch_from" lets you specify an URI to get this file from. If you do not specify one, your list of configured hosts will be probed to download the file from.

"force" forces a new download, even if the file already exists.

"verbose" simply indicates whether or not to print extra messages.

"prefer_bin" indicates whether you prefer the use of commandline programs over perl modules. Defaults to your corresponding config setting.

"ttl" (in seconds) indicates how long a cached copy is valid for. If the fetch time of the local copy is within the ttl, the cached copy is returned. Otherwise, the file is refetched.

"_fetch" figures out, based on the host list, what scheme to use and from there, delegates to "File::Fetch" do the actual fetching.

Returns the path of the output file on success, false on failure.

Note that you can set a "blacklist" on certain methods in the config. Simply add the identifying name of the method (ie, "lwp") to: $conf->_set_fetch( blacklist => ['lwp'] );

And the "LWP" function will be skipped by "File::Fetch".

Mark a particular host as bad. This makes "CPANPLUS::Internals::Fetch" skip it in fetches until this cache is flushed.

Query the cache to see if this host is ok, or if it has been flagged as bad.

Returns true if the host is ok, false otherwise.

2021-08-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.