Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-06-25 12:11 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (567 votes). Check out past polls.