Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Build tree data structure from DB (flat) data; function golf

by gryphon (Abbot)
on Aug 30, 2006 at 15:32 UTC ( [id://570409]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub tree_data {
      my ( $old_data, $key_name, $next_group, @remaining_keys ) = @_;
    ...
    
      return \@new_data;
    }
    
  2. or download this
    my $input = [
      {
    ...
        'other_data' => '123456789',
      },
    ];
    
  3. or download this
    my $output = [
      {
    ...
        ],
      },
    ];
    
  4. or download this
    # ...to generate the output example from above...
    my $output = tree_data( $input, 'team', 'employees' );
    ...
    my $output = tree_data(
      $input, 'team', 'employees', 'employee', 'work_days'
    );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://570409]
Approved by McDarren
Front-paged by shmem
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-03-28 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found