title: How can I check if a filehandle is open in Perl?
body: <p>Is there a way to check if a file is already open in Perl? 
  I want to have a read file access, so don't require <code>flock</code>.</p>
  
  <pre><code> open(FH, "&lt;$fileName") or die "$!\n" if (&lt;FILE_IS_NOT_ALREADY_OPEN&gt;);
   #  or something like
   close(FH) if (&lt;FILE_IS_OPEN&gt;);
  </code></pre>