param verification: is a handle?
param verification: is a handle?
am 08.04.2005 13:24:31 von 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
--
PGP-Key: 875F5C96
Re: param verification: is a handle?
am 08.04.2005 13:38:15 von Bernard El-Hagin
"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?
perldoc -f ref
--
Cheers,
Bernard
Re: param verification: is a handle?
am 08.04.2005 19:22:38 von Steven Kuo
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
Re: param verification: is a handle?
am 08.04.2005 21:26:22 von a-sicken
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