Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Converting HoA into AoH

by neversaint (Deacon)
on Oct 31, 2005 at 10:19 UTC ( #504218=note: print w/replies, xml ) Need Help??


in reply to Re: Converting HoA into AoH
in thread Converting HoA into AoH

Dear BrowserUk,
Thanks so much BrowserUk. But with your dataset example above it should give this result instead:
$VAR1 = [ { 'flintstones' => 'fred', 'jetsons' => 'george', 'domo' => 'harry' }, { 'flintstones' => 'fred', 'jetsons' => 'george', 'domo' => 'gatou' }, { 'flintstones' => 'barney', 'jetsons' => 'george', 'domo' => 'harry' }, { 'flintstones' => 'barney', 'jetsons' => 'george', 'domo' => 'gatou' }, { 'flintstones' => 'fred', 'jetsons' => 'jane', 'domo' => 'harry' }, { 'flintstones' => 'fred', 'jetsons' => 'jane', 'domo' => 'gatou' }, { 'flintstones' => 'barney', 'jetsons' => 'jane', 'domo' => 'harry' }, { 'flintstones' => 'barney', 'jetsons' => 'jane', 'domo' => 'gatou' } ];
So the size of individual size of hash must be the same with initial size of HoA.

---
neversaint and everlastingly indebted.......

Replies are listed 'Best First'.
Re^3: Converting HoA into AoH
by BrowserUk (Pope) on Oct 31, 2005 at 10:40 UTC

    There were two possibilities for the extended example, and I chose the wrong one (again).

    But it's only a one line change, to pass the number of keys in the hash rather than the constant 2-- assuming I understood this time?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2020-06-02 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (17 votes). Check out past polls.

    Notices?