Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How can I tell if a variable is a FileHandle?

Reply
Thread Tools

How can I tell if a variable is a FileHandle?

 
 
peterkayatwork@yahoo.com
Guest
Posts: n/a
 
      01-11-2005
I want to be able to tell if a variable is a FileHandle as opposed to a
string, hash, whatever. I know perl will tell me that it's a Glob:

If I do:

----code:
my $fh=\*STDIN;

print "Have [$fh]\n";
----end of code

it tells me
Have [GLOB(0x10131870)]

Thanks, perl.

If I do an "isa" to see if I've got a glob, what else could it be
besides a FileHandle?

Better yet, is there a more elegent way to tell if I've got a
FileHandle or a String?

--Peter

 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      01-11-2005
<(E-Mail Removed)> wrote in comp.lang.perl.misc:
> I want to be able to tell if a variable is a FileHandle as opposed to a
> string, hash, whatever. I know perl will tell me that it's a Glob:


See the current thread "GLOB vs IO::Handle"

Anno
 
Reply With Quote
 
 
 
 
peterkayatwork@yahoo.com
Guest
Posts: n/a
 
      01-13-2005
<blushes bring pink>

Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How can I tell if variable is defined Brown, Rodrick Python 7 09-22-2009 11:58 PM
Some people tell that at present, most web hosting servers supportall kinds of programming language, some people tell me that many web hostingserver don't support Java, What is the truth? Erwin Moller Java 3 05-07-2008 05:09 PM
CAN any one tell it whats the code tell it yogesh C++ 1 03-14-2007 01:12 PM
Script to Tell Tell Time then Limit by it? Mike A Javascript 17 11-19-2003 02:16 PM



Advertisments