Subject: | Example Code fails to run [fix suggested] |
Firstly, thanks psionic for writing this module. It has saved me time
and effort!
Using the example code for HTTP::Handle v0.2 on Perl v5.8.0 under Linux
2.4.22 I get the following error:
Can't call method "url" on unblessed reference at
/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Handle.pm line 89.
This I solved by moving the $self->url call to after the bless
I then received the following error:
Can't locate object method "new" via package "IO::Select" (perhaps you
forgot to load "IO::Select"?) at
/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Handle.pm line 144.
This I solved by adding the line:
use IO::Select;
Here's the diff:
--- ../tmp/HTTP-Handle/Handle.pm 2004-07-03 08:44:53.000000000 +0000
+++ /usr/lib/perl5/site_perl/5.8.0/HTTP/Handle.pm 2006-12-29
18:45:30.000000000 +0000
@@ -36,6 +36,7 @@
use strict;
use IO::Handle;
+use IO::Select;
use Socket;
use URI;
@@ -86,8 +87,8 @@
$self->{$key} = $val;
}
- $self->url($self->{"uri"}) if (defined($self->{"uri"}));
bless $self, $class;
+ $self->url($self->{"uri"}) if (defined($self->{"uri"}));
return $self;
}