my $VAR2; for my $h (@$VAR1){ $VAR2->{ $h->{name} } = $h; } print Dumper \$VAR2;