Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^5: how to construct tree from parent pointer list

by ikegami (Pope)
on Jun 30, 2009 at 19:21 UTC ( #776154=note: print w/replies, xml ) Need Help??


in reply to Re^4: how to construct tree from parent pointer list
in thread how to construct tree from parent pointer list

For example, what is '$cb'

The first argument. It's expected to be a code reference.

What I am trying to do is output the tree in a flattened format once the tree is built.

Based on the code from Re: Tree path analyzer regex problem (maybe other issues)?, a reply in an older thread of yours,

sub leaves { my $node = shift; my @children = $node->children(); if (!@children) { print(join('|', @_), "\n"); } else { for my $child (@children) { leaves($child, @_, $child->value()); } } }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2020-11-27 00:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?