print "its a file handle\n" if ( defined fileno($FH) );

/R

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ------------------------------------------------
> On Thu, 09 Jan 2003 06:36:25 -0500, Mark Goland <[EMAIL PROTECTED]>
wrote:
>
> > How about,
> >
> > print "its a file handle\n" if ( fileno($FH) );
> >
>
> This will only work if the fileno is not 0, and STDIN's fileno is 0. Could
be a problem if looking for something that could hold STDIN or if something
has redirected STDIN internally.  To be safe stick with the ref == GLOB
approach, though that might return true on things other than file handles,
not sure.
>
> http://danconia.org



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to