Hi,

I saw that the URI module returns a $uri -> host even though the URL used is
not a correct one.

For example I've seen bad addresses like:

http://www:site.com/

This is a wrong address but the host method returns "www:site.com".

I think it is a good idea to return a null value instead.

An example is the following example:

#!/perl/bin/perl -w

print "Content-type: text/html\n\n";

use strict;
use URI;

my $url = 'http://www:teddy.com/';

my $uri = URI -> new($url);

my $host = $uri -> host;
print "$host<br>";

my $scheme = $uri -> scheme;
print "$scheme<br>";


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]


Reply via email to