oswulf has asked for the wisdom of the Perl Monks concerning the following question:
Could anyone cast any light on what I'm doing wrong, please?#!/usr/bin/perl -w use strict; use LWP::UserAgent; use HTTP::Request; use HTTP::Response; use IO::File; my $url = 'http://www.aoov08.dsl.pipex.com/test.wma'; $url = URI->new($url); my $ua = LWP::UserAgent->new(); my $req = HTTP::Request->new(GET => $url); my $response = $ua->request($req); if ($response->is_error()) { print "Error " , $response->status_line, "\n"; } else { open(FILE, "> test.wma"); print FILE $response->content(); close(FILE); } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTTP::Response problem
by Corion (Patriarch) on Feb 23, 2004 at 09:01 UTC |