9
my %hash = ( 1 => 'foo', 2 => 'bar', 3 => 'bar' );
12
is_deeply( $f = %hash->flip, { foo => 1, bar => 3 } );
16
is_deeply( \%f, { foo => 1, bar => 3 }, "Returns hash in list context" );
18
my %nested = ( 1 => { foo => 'bar' }, 2 => 'bar' );
20
dies_ok { %nested->flip } 'Dies if values are not valid hash keys';