Well, you probably want to test for defined eval { fileno $fh }...
$fh = \*STDIN; print "Nope\n" unless eval {fileno $fh};
It still doesn't really work, though. This must be the first example of code that doesn't work with no strict! Try this:
This prints <samp>Nope</samp> with strict (can't use string as symbol ref), but not without strict...$fh = 'STDOUT'; print "Nope\n" unless defined eval {fileno $fh};
In reply to Re: Determining indirect filehandles
by ariels
in thread Determining indirect filehandles
by Masem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |