in reply to LWP::UserAgent error Unexpected keys - LocalHost

I used your script without any changes and it worked (downloaded perlmeme.org and perlmeme.org/tutorials/lwp.html)

try this:

... # as before... use Data::Dumper; my $req = GET 'http://www.perlmeme.org'; print Dumper $req->{_headers}; ... if ($res->is_success) { print $res->content; } else { print Dumper $res->{_headers}; }
Also, try Console::Logger. Maybe it will tell something.

Replies are listed 'Best First'.
Re^2: LWP::UserAgent error Unexpected keys - LocalHost
by trendle (Novice) on Jul 29, 2014 at 23:13 UTC

    Thanks

    I tried the extra lines, this is what I got

    $VAR1 = bless( {}, 'HTTP::Headers' ); $VAR1 = bless( { 'client-warning' => 'Internal response', 'client-date' => 'Tue, 29 Jul 2014 23:07:18 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ); >> 500 Unexpected keys - LocalHost

    As I said at the start, I'm not surprised that you were able to make it work, I can too an another PC.

    My problems is that the Mint10 PC that I'm normally using is giving the problem. I'm trying to find out how to fix it. Unfortunately the debugging info is rather hard to get to grips with for a novice.

      Hmm... that's not actually LWP's response (despite that 'internal' stuff). Do you use a proxy by any chance? It seems Python's urllib can automatically detect it. Try
      my $ua = ... # as before $ua->env_proxy; ...
        Oh wait, I forgot - it's actually LWP's response.