in reply to Compare URIs
use strict; use warnings; use URI (); my $base_uri = 'http://host/index.html'; my $uri1 = '/bob?joe=1&jack=2'; my $uri2 = 'http://host/bob?jack=2&joe=1'; $uri1 = URI->new($uri1)->abs($base_uri); $uri2 = URI->new($uri2)->abs($base_uri); print($uri1->canonical, "\n"); print($uri2->canonical, "\n"); print(URI::eq($uri1, $uri2) ? "equal" : "not equal", "\n");
Output:
http://host/bob?joe=1&jack=2 http://host/bob?jack=2&joe=1 not equal
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compare URIs
by halley (Prior) on Oct 18, 2005 at 16:07 UTC | |
by ikegami (Patriarch) on Oct 18, 2005 at 16:16 UTC |