Perl: the Markov chain saw | |
PerlMonks |
checking a file handle to see if it is openby powerhouse (Friar) |
on Apr 05, 2006 at 07:15 UTC ( [id://541296]=perlquestion: print w/replies, xml ) | Need Help?? |
powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
Is there a way to test if a file handle like MAIL is open before I use close(MAIL)? I have someone elses program I bought, and they have tons of stuff going on, then out of the blue they are running the command close(MAIL), and I am getting a recipient error, but the mail is getting sent out. So I think that close(MAIL) is called earlier, and when it is called again, since there is no MAIL open now, it is generating that error, so is there a way to do it like this or something: close(MAIL) if open(MAIL)? or just close(MAIL) if MAIL;? Thank you in advance for your wisdom.
thx, Richard
Back to
Seekers of Perl Wisdom
|
|