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

RE: URI Bug?

Thread Previous | Thread Next
Thurn, Martin
November 23, 2002 10:39
RE: URI Bug?
Message ID:
> use URI::URL;
> $attr_value = "products/index.html";  # This is a valid relative link!
> $url = url $attr_value;
> $host = $url->host;

From the point of view of the URI object, 'products/index.html' is not a
URL, it is a path.  Therefore, you should try

my $url = new URI;

But I'm not sure what good is a URL without a host...

 - - Martin 'Kingpin' Thurn 

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About