title: How do I replace the values of a hash in an external file?
body: <p>For my program, I'm attempting to replace the value of a specific hash in an external file with a newly created value. The external file has the value tab-delimited from the key, and I had read the hash in from the external file. I've been looking around online, and this is the closest way I could figure out how to do it, yet it doesn't seem to work.</p>
  
  <pre><code>            open(IN, "&gt;&gt;$file") || die "can't read file $file";
              while (&lt;IN&gt;) {
              print IN s/$hash{$key}/$newvalue/;
              }
             close (IN) 
  </code></pre>
  
  <p>I'm not quite sure what I'm missing in this formula.</p>