http://qs321.pair.com?node_id=1095543


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

Here's a slightly modified script that worked on my versions of perl from 5.8.8 thru 5.20.0. Note: Always use strictures.
#!/usr/bin/perl -l use strict; use warnings; require LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->agent("Mozilla/8.0"); $ua->cookie_jar( { file => 'mycookies.txt', autosave => 1 } ); my $url = 'http://www.perlmeme.org/'; my $req = HTTP::Request->new( 'GET', $url ); my $res = $ua->request( $req, undef, undef ) || die( 'Get'->Bad ); if ( $res->is_success ) { print $res->decoded_content; } else { print ">> ", $res->status_line; }

Replies are listed 'Best First'.
Re^2: LWP::UserAgent error Unexpected keys - LocalHost
by Anonymous Monk on Jul 30, 2014 at 02:48 UTC

    Here's a slightly modified script that you can ignore

    That won't make any difference

    The OPs IO::Socket::SSL/IO::Socket::IP... and other supporting LWP modules are out of sync (one is new other is old)

    OP needs the latest ones and to learn to ignore irrelevant advice

      Thanks for the suggestions. I still cannot figure what tweak would fix it for me.

      So I've taken the pragmatic approach and installed a parallel 'ActiveState' perl.

      It has all the right modules pre-installed. And LO, all the tests that failed previously now work with the Active Perl.

      It's a good enough compromise until I get my upgrade PC up and running.

      Regards to all.