1CPANPLUS::Internals::FeUtscehr(3C)ontributed Perl DocumeCnPtAaNtPiLoUnS::Internals::Fetch(3)
2
3
4
6 CPANPLUS::Internals::Fetch
7
9 my $output = $cb->_fetch(
10 module => $modobj,
11 fetchdir => '/path/to/save/to',
12 verbose => BOOL,
13 force => BOOL,
14 );
15
16 $cb->_add_fail_host( host => 'foo.com' );
17 $cb->_host_ok( host => 'foo.com' );
18
20 CPANPLUS::Internals::Fetch fetches files from either ftp, http, file or
21 rsync mirrors.
22
23 This is the rough flow:
24
25 $cb->_fetch
26 Delegate to File::Fetch;
27
30 => 'scheme://path/to/fetch/from', verbose => BOOL, force => BOOL, pre‐
31 fer_bin => BOOL] )
32 "_fetch" will fetch files based on the information in a module object.
33 You always need a module object. If you want a fake module object for a
34 one-off fetch, look at "CPANPLUS::Module::Fake".
35
36 "fetchdir" is the place to save the file to. Usually this information
37 comes from your configuration, but you can override it expressly if
38 needed.
39
40 "fetch_from" lets you specify an URI to get this file from. If you do
41 not specify one, your list of configured hosts will be probed to down‐
42 load the file from.
43
44 "force" forces a new download, even if the file already exists.
45
46 "verbose" simply indicates whether or not to print extra messages.
47
48 "prefer_bin" indicates whether you prefer the use of commandline pro‐
49 grams over perl modules. Defaults to your corresponding config setting.
50
51 "_fetch" figures out, based on the host list, what scheme to use and
52 from there, delegates to "File::Fetch" do the actual fetching.
53
54 Returns the path of the output file on success, false on failure.
55
56 Note that you can set a "blacklist" on certain methods in the config.
57 Simply add the identifying name of the method (ie, "lwp") to:
58 $conf->_set_fetch( blacklist => ['lwp'] );
59
60 And the "LWP" function will be skipped by "File::Fetch".
61
62 _add_fail_host( host => $host_hashref )
63
64 Mark a particular host as bad. This makes "CPANPLUS::Internals::Fetch"
65 skip it in fetches until this cache is flushed.
66
67 _host_ok( host => $host_hashref )
68
69 Query the cache to see if this host is ok, or if it has been flagged as
70 bad.
71
72 Returns true if the host is ok, false otherwise.
73
74
75
76perl v5.8.8 2007-03-31 CPANPLUS::Internals::Fetch(3)