param verification: is a handle?

A

A. Sicken

Hello,

I have to handle follwing problem: A class method can be called with an
argument, which can be
a) a simple filename
b) a glob (perls default file handles)
c) a reference to a glob (IO::Handle object for example)

How do I verify the argument? Or where can I find an example how to do
it?

In advance, thanx
AndSi
 
S

Steven Kuo

Hello,

I have to handle follwing problem: A class method can be called with an
argument, which can be
a) a simple filename
b) a glob (perls default file handles)
c) a reference to a glob (IO::Handle object for example)

How do I verify the argument? Or where can I find an example how to do
it?



The 'openhandle' function in Scalar::Util should do this nicely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top