|
|
| Just another Perl shrine | |
| PerlMonks |
checking bareword-filehandleby morgon (Chaplain) |
| on Aug 06, 2012 at 13:08 UTC ( #985699=perlquestion: print w/ replies, xml ) | Need Help?? |
|
morgon has asked for the
wisdom of the Perl Monks concerning the following question:
Hi
I have inherited some tangled mess of code that uses barewords for filehandles like so: The problem is that when the open fails the code goes on (doing many other things) and when it comes to the print Perl emits a warning as FH is not an open filehandle (strict and warnings are on). I don't want to go into the code right now, all I want is to suppress the warning, but I cannot write as FH is a bareword. So my question is: What is the idiomatic way to check a such a filehandle? Many thanks!
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||