running this program:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; require LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->get('http://search.cpan.org/'); print Dumper $response; if ($response->is_success) { print $response->decoded_content; }
generates this output
$VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '', '_rc' => '200', '_headers' => bless( { 'connection' => 'close', 'client-response-num' => 1, 'last-modified' => 'Wed, 02 Nov 2011 17:44:19 GMT', 'cache-control' => 'max-age=3599', 'date' => 'Wed, 02 Nov 2011 17:44:19 GMT', 'client-peer' => '199.15.176.161:80', 'content-length' => '5752', 'age' => '8', 'client-aborted' => 'die', 'client-date' => 'Wed, 02 Nov 2011 19:18:15 GMT', 'x-died' => 'Can\'t load \'/opt/local/lib/perl5/site_perl/5. +8.9/darwin-2level//auto/HTML/Parser/Parser.bundle\' for module HTML:: +Parser: dlopen(/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level//au +to/HTML/Parser/Parser.bundle, 1): Symbol not found: _PL_curpad Referenced from: /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level// +auto/HTML/Parser/Parser.bundle Expected in: dynamic lookup at /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level//HTML/Parser.pm + line 17 Compilation failed in require at /opt/local/lib/perl5/site_perl/5.8.9/ +darwin-2level//HTML/Entities.pm line 152. Compilation failed in require at /opt/local/lib/perl5/site_perl/5.8.9/ +darwin-2level//HTML/HeadParser.pm line 85. BEGIN failed--compilation aborted at /opt/local/lib/perl5/site_perl/5. +8.9/darwin-2level//HTML/HeadParser.pm line 85. Compilation failed in require at /opt/local/lib/perl5/site_perl/5.8.9/ +LWP/UserAgent.pm line 638.', 'content-type' => 'text/html', 'server' => 'Plack/Starman (Perl)', 'expires' => 'Wed, 02 Nov 2011 18:44:19 GMT' }, 'HTTP::Headers' ), '_msg' => 'OK', 'default_add_content' => 1, '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = 'http://search.cpan.org/')}, ' +URI::http' ), '_headers' => bless( { 'user-agent' => 'libwww-perl/6.03' }, 'HTTP::Headers' ), '_method' => 'GET', '_uri_canonical' => $VAR1->{'_request'}{'_uri'} }, 'HTTP::Request' ) }, 'HTTP::Response' ); Use of uninitialized value in print at ./t.pl line 13.
environment:
perl: v5.8.9 built for darwin-2level
os: Darwin lski1167.mskcc.org 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
cpan says:
LWP::UserAgent is up to date (6.03).

In reply to libwww-perl fails by arthurg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.