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
In reply to Re: Compare URIs
by ikegami
in thread Compare URIs
by gam3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |