Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: LWP::UserAgent error Unexpected keys - LocalHost

by Khen1950fx (Canon)
on Jul 30, 2014 at 01:52 UTC ( #1095543=note: print w/replies, xml ) Need Help??

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 = ''; 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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1095543]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2019-05-24 03:41 GMT
Find Nodes?
    Voting Booth?
    Do you enjoy 3D movies?

    Results (147 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!