Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Generating a Hash of Hashes Recursively to Display Database Hierarchy

by c4onastick (Friar)
on Jun 23, 2009 at 15:17 UTC ( [id://774056]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $data = [
       [ 'parent1', 'child1a', 'child2a', undef,    ],
       [ 'parent1', 'child1b', 'child2b', 'child3b',],
       [ 'parent1', 'child1c', undef, undef,],
    ];
    
  2. or download this
    my @results;
    foreach my $row (@$data) {
       push @results, treeify(@$row);
    ...
       return {} unless $node;
       return {$node => treeify(@list)};
    }
    
  3. or download this
    $VAR1 = {
              'parent1' => {
                             'child1a' => {
    ...
                             'child1c' => {}
                           }
            };
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found