How can I check if a filehandle is open in Perl?
- by matt
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 flock.
open(FH, "<$fileName") or die "$!\n" if (<FILE_IS_NOT_ALREADY_OPEN>);
# or something like
close(FH) if (<FILE_IS_OPEN>);