Madhu Reddy wrote:
hi,

Hello,

   I want to check the status of File handle before
reading/writing to file ? How to do this ?

like following

open(FH_IN_FILE, ">file.txt");

# This statement is executed by some other function
close(FH_IN_FILE);



print FH_IN_FILE "SOME DATA";

here before writing to file, i want to check the
status of FH_IN_FILE..(whether file is opened or
closed )

if ( defined fileno FH_IN_FILE ) { print FH_IN_FILE "SOME DATA"; } else { warn "Error: FH_IN_FILE is closed!\n"; }



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to