[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URI Comparisons (something practical)




Jeremy Smith wrote:


#!/usr/bin/perl
use warnings;
use strict;
use URI;

foreach my $result (URI::eq('http://example.org', 'http://example.org/' ),
URI::eq('http://example.org', 'HTTP://example.org' ),
URI::eq('http://example.org', 'http://example.org:' ),
URI::eq('http://example.org', 'http://example.org:80' ),
URI::eq('http://example.org', 'http://Example.org' ),
URI::eq('http://example.org/~smith', 'http://example.org/%7Esmith'),
URI::eq('http://example.org/~smith', 'http://example.org/%7esmith'),
URI::eq('http://example.org/%7Esmith', 'http://example.org/%7esmith'),
URI::eq('http://example.org/%C3%87', 'http://example.org/C%CC%A7' ), )
{
print $result ? "true\n" : "false\n";
}


__OUTPUT__
true
true
true
true
true
true
true
true
false

Speaking of which -- why would anybody want the last comparison to evaluate to "true"?


Julian

--
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760