title: Parent Child Perl Data Structure
body: <p>I have a datafile that has a list of paired values representing river flow relationships.</p>
  
  <p>The file has this structure</p>
  
  <pre><code>Node       Downstream Node
  A          B
  B          C
  C          D
  E          C
  
  etc
  </code></pre>
  
  <p>What I need to do is read this file and then for any given node, I need all the UPSTREAM nodes printed.</p>
  
  <p>In the example above if I entered C, I would get E, B, A.</p>
  
  <p>I am using perl on a linux box and the person I am writing this for is too.  Thanks.</p>