title: get last few lines of file stored in variable
body: <p>How could I get the last few lines of a file that is stored in a variable? On linux I would use the tail command if it was in a file.</p>
  
  <pre><code>1) How can I do this in perl if the data is in a file?
  2) How can I do this if the content of the file is in a variable?
  </code></pre>