#! 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] } @_ ]; } #### 16:56 >perl 1314_SoPW.pl 1..2 not ok 1 - Deep # Failed test 'Deep' # at 1314_SoPW.pl line 22. # Comparing $data as a Bag # Missing: 1 reference # Extra: 1 reference -------------------- not ok 2 - More # Failed test 'More' # at 1314_SoPW.pl line 24. # Structures begin differing at: # $got->[1]{b}[0] = '1' # $expected->[1]{b}[0] = '0' # Looks like you failed 2 tests of 2. 16:56 >