Front page | perl.libwww |
Postings from November 2002
Re: URI Bug?
From: Octavian Rasnita
November 23, 2002 18:41
Re: URI Bug?
Message ID: email@example.com
I have the same problem under Windows 2000, running Perl 5.8.0.
The error was the same but it was found in HTTP/cookies.pm file.
It happends only for some links, but for the moment I don't know for what
Teddy's Center: http://teddy.fcc.ro/
----- Original Message -----
From: "Hans de Graaff" <firstname.lastname@example.org>
Sent: Saturday, November 23, 2002 7:41 PM
Subject: Re: URI Bug?
Hmm, it seems my post got corrupted somehow. Here's what I wrote:
On Thu, 21 Nov 2002, Darby Cacdac wrote:
> Im using the URI (1.22) module and I'm getting the error:
> "Can't locate object method "host" via package "URI::_generic"
> (perhaps you forgot to load "URI::_generic"?) at
> /usr/perl5/site_perl/5.6.1/URI/WithBase.pm line 50."
> It turns out that this error comes up when I'm doing a $url->host on
> a link that looks like this: <a href=3D"httpthrds/index.html">. As
> long as the link starts with http* (aside from http://*) the error
> is triggered.
I think the problem is that host() is only supported for those schemes
that have an authority component (see perldoc URI for more
details). It would be nice if there would be a simple test to
determine which schemes qualify for this. Currently I have this
hardcoded in my application to do this:=20
$url->host(ip_address($url->host)) if $url->scheme =3D~ /^(https?|ftp|g=
I'd be happy to learn of a better way to do this, and I'm sure my list
is not complete anyway. I don't track new schemes being added, and
this may vary from installation to installation anyway.