in reply to Compare URIs

with the caveats as described above (++), you could pull, and sort the parameters. You're then left with a simple string comparison.
use URI; my $u1 = URI->new('http://host/bob?jack=2&joe=1'); my $u2 = URI->new('http://host/bob?joe=1&jack=2'); if ( sort_query($u1->query()) ne sort_query($u2->query())) { print "They're different all right\n"; } sub sort_query { join('&', sort split /&/, $_[0]) }
UPDATE: Ack, updated after ikegami's comments.
---
my name's not Keith, and I'm not reasonable.

Replies are listed 'Best First'.
Re^2: Compare URIs
by ikegami (Patriarch) on Oct 18, 2005 at 16:21 UTC