develooper Front page | perl.libwww | Postings from November 2002

Re: URI Bug?

Thread Previous | Thread Next
From:
Octavian Rasnita
Date:
November 23, 2002 18:41
Subject:
Re: URI Bug?
Message ID:
001d01c29363$10f210a0$b46fe9d5@microsoft.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
types.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: orasnita@home.ro

----- Original Message -----
From: "Hans de Graaff" <hans@degraaff.org>
To: <libwww@perl.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:
>=20
> "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."
>=20
> 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=
opher|https|ldap|news|nntp|pop|rlogin|snews|telnet)$/;

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.

Hans




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About