hi,
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
hi,
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);
Which itself is a bad idea, always check that the open succeeded in the
first place,
open FH_IN_FILE, file.txt or die Can't open file for
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 )
You could do something like the following:
-
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,