in reply to test if a scalar contains a filename or a filehandle?
From the pod:
It uses several methods, including fileno(), to try to determine if the scalar is a valif FH.openhandle FH Returns FH if FH may be used as a filehandle and is open, or FH is a tied handle. Otherwise undef is returned. $fh = openhandle(*STDIN); # \*STDIN $fh = openhandle(\*STDIN); # \*STDIN $fh = openhandle(*NOTOPEN); # undef $fh = openhandle("scalar"); # undef
--
John.
|
|---|