DBIx-TextSearch
view release on metacpan or search on metacpan
lib/DBIx/TextSearch.pm view on Meta::CPAN
sub _http {
# fetch a file via http and store locally
my ($self, $url) = @_;
print "URL to fetch: $url\n";
# get unique name for local file
my $local_file = _get_unique_filename();
# fetch the file
my $ua = LWP::UserAgent->new;
my $request = HTTP::Request->new('GET', $url);
my $response = $ua->request($request);
if ($response->is_success) {
# sucessful fetch
# write to disk
my $html = $response->content;
CORE::open(HTML, ">$local_file") or
croak "Can't save HTML file $url to $local_file: $!";
print HTML $html;
close HTML;
( run in 0.864 second using v1.01-cache-2.11-cpan-de7293f3b23 )