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 (Patriarch) 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.