title: Perl - Append to last line of a file
body: <p>I am a Perl novice, can someone please let me know how to append an output file's last entry based on the current value?
  E.g. I am generating a output txt file say</p>
  
  <pre><code>a b c d 10
  </code></pre>
  
  <p>With some processing I get value 20 and now I want this value 20 to be assigned and aligned with previous set which is</p>
  
  <pre><code>a b c d 10
  </code></pre>
  
  <p>and make it as</p>
  
  <pre><code>a b c d 10 20
  </code></pre>