Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Perl Recursion

by Limbic~Region (Chancellor)
on Sep 26, 2011 at 18:18 UTC ( #927915=note: print w/replies, xml ) Need Help??

in reply to Perl Recursion

It sounds like your tab delimited file is a text representation of a tree. I believe you have implied but not explicitly stated that if A is related to B and B is related to C that A is related to C. If that's the case, and your file looks like the following:
object_1 object_2 active object_2 object_3 active

You need to first identify which of the two columns (1 or 2) represents the parent in the relationship. Next, you need to identify the root(s), and build the tree in memory (assuming the file will fit in memory). Once you have done that, you just need to find the node you want to deactivate and walk the tree below that point deactivating all attached nodes.

Cheers - L~R

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2016-09-28 13:48 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (531 votes). Check out past polls.