use Data::Compare; my $hr1 = {a=>'foo',b=>'bar'}; my $hr2 = {b=>'bar',a=>'foo'}; print "They are ", (Compare($hr1,$hr2) ? "the same" : "different"), "\n";