#! perl use strict; use warnings; use Test::More tests => 2; use Test::Deep; my @x = ( { j => 12, a => 1 }, { b => [1, 11] }, { c => 3 } ); my @y = ( { c => 3 }, { b => [0, 11] }, { a => 1, j => 12 } ); cmp_deeply( \@x, bag(@y), 'Deep' ); print '-' x 20, "\n"; is_deeply( sort_hash(@x), sort_hash(@y), 'More' ); sub sort_hash { return [ sort { (sort keys %$a)[0] cmp (sort keys %$b)[0] } @_ ]; }