Hey All,
I'm dealing with some large XML files, which I only need the first few lines. I don't really want to get the whole file, is there a nice way, using LWP to only get the first say 5k? I'm using the really basic HTTP::Request...
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->agent("Faux Browser/1.0");
my $req = HTTP::Request->new(GET=>$url);
$req->content_type('application/x-www-form-urlencoded');
$req->content('query=libwww-perl&mode=dist');
my $res = $ua->request($req);
if ($res->is_success) {
# do stuff
} else {
# error out
}