As per @choroba I tried the following code:
use Data::Dumper;
my @arrayofhashes = [
{
'a' => 4,
'b' => 3
},
{
'c' => 5,
'a' => 2
}
];
my %merged;
@merged{ keys %$_ } = values %$_ for @arrayofhashes;
print Dumper \%merged;
That is supposed to dump:
$VAR1 = {
'a' => 2,
'b' => 3,
'c' => 5,
};
But is instead failing with:
"Not a HASH reference"
Thanks again.