http://www.perlmonks.org?node_id=260068


in reply to Re: LWP::UserAgent destroys $response->content >:{
in thread LWP::UserAgent destroys $response->content >:{

I don't think this is an LWP::UserAgent problem. It may be something specific to the Linksys "web server". I can grab the status page from my Netgear router with no problem using this code:
#!/usr/local/bin/perl use strict; use warnings; $| = 1; use LWP::UserAgent; use HTTP::Request::Common qw(GET POST); use HTTP::Cookies; my $user = 'user'; my $pass = 'pass'; my $cookie_jar = HTTP::Cookies->new(file => '/tmp/cookie_jar', AutoSav +e => 1); my $ua = LWP::UserAgent->new(); $ua->cookie_jar($cookie_jar); my $req = GET 'http://192.168.0.1/mtenSysStatistics.html'; $req->authorization_basic($user, $pass); my $response = $ua->request($req); print $response->code . ' ' . $response->message . "\n"; my $content = $response->content; if ($content) { print $content; } else { print 'No content!'; } print "\n";

Can you give this a try (after adjusting for your environment) and see if you still get the 500 error?