>>>>> "Mark" == Mark Fowler <[EMAIL PROTECTED]> writes:

Mark> How do I determine if something passed to me is a filehandle or something
Mark> containing the name of the file to open.  This *should* be fairly simple,
Mark> but I can't work out a simple way to do it.

If it's an open filehandle, or a string containing the name of an open
filehandle, defined fileno($foo) will be true.

Otherwise, { not ref($foo) or UNIVERSAL::isa($foo,"IO::File") } will
tell if it is "openable".  The former may be disabled under use
strict (as a symbolic filehandle), but I can't recall.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to