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