Subject: | "Hello World" fails: Symbol not found: _PL_curpad |
running
cpan[2]> install LWP::UserAgent
LWP::UserAgent is up to date (6.03).
This is perl, v5.8.9 built for darwin-2level
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
there's a problem with the dependencies in the install, I think.
but Parser.bundle is present:
[40 goldbera@lski1167:~/Documents/workspace/JobTalk]$ ls -l
/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level//auto/HTML/Parser/Parser.bundle
-r-xr-xr-x 1 root admin 46328 Nov 2 13:10
/opt/local/lib/perl5/site_perl/5.8.9/darwin-2level//auto/HTML/Parser/Parser.bundle
the attached program t.pl produces:
$VAR1 = bless( {
'_protocol' => 'HTTP/1.1',
'_content' => '',
'_rc' => '200',
'_headers' => bless( {
'connection' => 'close',
'client-response-num' => 1,
'last-modified' => 'Wed, 02 Nov
2011 16:50:21 GMT',
'cache-control' => 'max-age=3599',
'date' => 'Wed, 02 Nov 2011
16:50:21 GMT',
'client-peer' =>
'199.15.176.161:80',
'content-length' => '5752',
'age' => '1401',
'client-aborted' => 'die',
'client-date' => 'Wed, 02 Nov
2011 17:13:42 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//auto/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
17:50:21 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 17.
Subject: | t.pl |
#!/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;
}