my $open = fileno($fh); # if open is NOT undef the file is open