title: File::Temp pass system command output to temp file
body: <p>I'm trying to capture the output of a <em>tail command</em> to a temp file. </p>
  
  <p>here is a sample of my <a href="http://pastebin.com/raw/TXDgaT2E" rel="nofollow">apache access log</a></p>
  
  <p>Here is what I have tried so far. </p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  use File::Temp ();
  use File::Temp qw/ :seekable /;
  
  chomp($tail = `tail access.log`);
  
  my $tmp = File::Temp-&gt;new( UNLINK =&gt; 0, SUFFIX =&gt; '.dat' );
  print $tmp "Some data\n";
  print "Filename is $tmp\n";
  </code></pre>
  
  <p>I'm not sure how I can go about passing the output of <code>$tail</code> to this temporoy file. </p>
  
  <p>Thanks</p>