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

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]
[holli]: i am designing an interface. check this out, can you tell immediatly tell me what the code does?
[holli]: scratch one "tell". you decide which ;)
[danaj]: :) Thanks, I should visit more often.
[holli]: you should visit the link i posted and answer my question
[stonecolddevin]: good afternoon all
[holli]: if you know what's good for you
[holli]: hahaha
[stonecolddevin]: hey holli, long time no chat

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-09-26 21:18 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (297 votes). Check out past polls.