in reply to How to loop through hash of array and convert into hash with key and value.

Verified working code:
$VAR1 = { map { $_->{name} => $_ } @$VAR1 };
Don't be shy about asking specific, detailed questions on how/why that works, after researching the "map" function.

                "From there to here, from here to there, funny things are everywhere." -- Dr. Seuss

  • Comment on Re: How to loop through hash of array and convert into hash with key and value.
  • Download Code

Replies are listed 'Best First'.
Re^2: How to loop through hash of array and convert into hash with key and value.
by Sami_R (Sexton) on Dec 28, 2019 at 11:11 UTC
    Mapping worked after modifying like...
    my $VAR3 = { map { delete $_->{name} => $_ } @$VAR1 };
    Thanks.
Re^2: How to loop through hash of array and convert into hash with key and value.
by stevieb (Canon) on Dec 28, 2019 at 02:42 UTC

    Unfortunately, this doesn't address removing the name from the inner hash references.