NAME

TeXLive::TLDownload -- TeX Live persistent downloads via LWP

SYNOPSIS

use TeXLive::TLDownload;

$TeXLive::TLDownload::net_lib_avail
my $dl = TeXLive::TLDownload->new();
$dl->get_file($relpath, $output [, $expected_size ]);
if ($dl->enabled) ...
if ($dl->disabled) ...
$dl->enable;
$dl->disable;
$dl->errorcount([n]);
$dl->incr_errorcount;
$dl->decr_errorcount;
$dl->reset_errorcount;

DESCRIPTION

The TeXLive::TLDownload is a wrapper around the LWP modules that allows for persistent connections and different protocols. At load time it checks for the existence of the LWP module(s), and sets $TeXLive::TLDownload::net_lib_avail accordingly.

Using proxies

Please see LWP::UserAgent for details, in a nut shell one can specify proxies by setting protocol_proxy variables.

Automatic disabling

The TLDownload module implements some automatic disabling feature. Every time a download did not succeed an internal counter (errorcount) is increased, everytime it did succeed it is decreased (to a minimum of 0). If the number of error goes above the maximal error count, the download object will be disabled and get_file always returns undef.

In this cases the download can be reset with the reset_errorcount and enable function.

SEE ALSO

LWP

AUTHORS AND COPYRIGHT

This script and its documentation were written for the TeX Live distribution (https://tug.org/texlive) and both are licensed under the GNU General Public License Version 2 or later.