Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to loop through hash of array and convert into hash with key and value.

by NetWallah (Canon)
on Dec 28, 2019 at 02:40 UTC ( [id://11110683]=note: print w/replies, xml ) Need Help??


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

A more "traditional" approach:
my $VAR2; for my $h (@$VAR1){ $VAR2->{ $h->{name} } = $h; } print Dumper \$VAR2;

                "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:15 UTC

    Great solutions, thank you so much.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11110683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found