title: End open file wih perl for frequently updated reports
body: <p>I have a daemon which needs to report a small hash of statistics to a file in a /dev/loop0 filesystem. I am using FileHandle to store the reference to the filehandle in perl. So a real small version of the problem looks like this:</p>
  
  <pre><code>#!/usr/bin/perl
  
  use strict;
  use warnings;
  use FileHandle;
  
  my $report = FileHandle-&gt;new("&gt; /devfs/test");
  print $report "Hello";
  seek($report,0,0);
  print $report "Hi";
  $report-&gt;close();
  </code></pre>
  
  <p>The result from this will be Hillo, which is what I'd expect. What I'd like to do is be able to indicate after Hi (and really Hello), that the file is now finished.</p>
  
  <p><strong>Question:</strong> When reading from a file, you can just search for the end of file (EOF), but how can I indicate the end of a file on write without closing it? If it makes a difference, the solution needs to apply to Linux specifically.</p>