In list context hash is flattened.
my @bar = ( %hash, %hash );
The array @bar
is initialized by list of two %hash
hashes
%hash
are flattened@bar
array is initialized by that listIt is guaranteed that key-value pairs goes together. Keys are always even indexed, values - odd. It is not guaranteed that key-value pairs are always flattened in same order:
my %hash = ( a => 1, b => 2 );
print %hash; # Maybe 'a1b2' or 'b2a1'