open $a, "/etc/passwd" or die "can't open /etc/passwd: $!\n"; { local $/ = undef; $userdetails = <$a>; print ">>",$userdetails,"<<\n"; } close($a); # this closes the filehandle print "A>",$a ,"<\n"; # this prints a glob # .... (assume that some lines of code lies here) # .. ######################################################### # in some other part of the program, How do I check whether # the filehandle associated with the handle is still open? # I have done it this way, if(defined fileno($a)), # because fileno(filehandle) will return undef if there is # no filehandle associated with it. # Is any other ways exist to check the above problem?. #########################################################