in reply to Compare URIs
This worked for me ...
The idea is to turn the URI's params into hash references via URI::QueryParam and map and compare them with Data::Compare. Assuming you only want to compare the params, of course. ;)use URI; use URI::QueryParam; use Data::Compare; my $uri1 = URI->new('/bob?joe=1&jack=2'); my $uri2 = URI->new('http://host/bob?jack=2&joe=1'); print "URI's are ", Compare( {map {($_ => $uri1->query_param($_))} $uri1->query_param}, {map {($_ => $uri2->query_param($_))} $uri2->query_param}, ) ? "" : "not ", "identical.\n" ;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compare URIs *params*
by Skeeve (Parson) on Oct 18, 2005 at 17:10 UTC | |
by jeffa (Bishop) on Oct 18, 2005 at 17:57 UTC |