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

RE: URI Bug?

Thread Previous | Thread Next
From:
Thurn, Martin
Date:
November 23, 2002 10:39
Subject:
RE: URI Bug?
Message ID:
7F4052F315B5B545B94096DC3973998502CA5E06@xcgva035.northgrum.com
> 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;
$url->path('products/index.html');

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

--
 - - Martin 'Kingpin' Thurn 

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