use Array::Compare; my %hash = ( one => [ qw/ foo bar baz / ], two => [ qw/ baz foo bar / ], ); print "the same" if Array::Compare->new()->perm(@hash{qw/one two/}); __output__ the same