in reply to Determining indirect filehandles
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};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Determining indirect filehandles
by Masem (Monsignor) on Jan 23, 2002 at 23:27 UTC |