Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Converting HoA into AoH

by tphyahoo (Vicar)
on Oct 31, 2005 at 13:40 UTC ( [id://504256]=note: print w/replies, xml ) Need Help??


in reply to Converting HoA into AoH

Not sure if this repeats what's already been said, but in case this helps:

UPDATE: Except I didn't do the cartesian product... but anyways...

use strict; use warnings; use Data::Dumper; my $AoH_show_characters = []; my $HoA_show_characters = { flintstones => [ "fred", "barney" ], jetsons => [ "george", "jane"], }; foreach my $show (keys %$HoA_show_characters) { foreach my $character ( @{ $HoA_show_characters->{$show} } ) { push @$AoH_show_characters, ( { $show => $character } ); } } print Dumper($AoH_show_characters);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found