sub compare_keys { my ($h1,$h2); my ($k1,$k2) = ( join('',sort keys %$h1), join('',sort keys %$h2) ); return $k1 eq $k2 ? 1 : 0; }