Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   param verification: is a handle? (http://www.velocityreviews.com/forums/t891705-param-verification-is-a-handle.html)

A. Sicken 04-08-2005 11:24 AM

param verification: is a handle?
 
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

--
PGP-Key: 875F5C96

Steven Kuo 04-08-2005 05:22 PM

Re: param verification: is a handle?
 
On Fri, 8 Apr 2005, A. Sicken wrote:

> 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.

--
Hope this helps,
Steven

A. Sicken 04-08-2005 07:26 PM

Re: param verification: is a handle?
 
Steven Kuo wrote:

> On Fri, 8 Apr 2005, A. Sicken wrote:
>
>> 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.
>


Thank, you - that's it!
AndSi
--
PGP-Key: 875F5C96


All times are GMT. The time now is 04:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.