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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top