param verification: is a handle?

Discussion in 'Perl Misc' started by A. Sicken, Apr 8, 2005.

  1. A. Sicken

    A. Sicken Guest

    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
     
    A. Sicken, Apr 8, 2005
    #1
    1. Advertising

  2. A. Sicken

    Steven Kuo Guest

    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
     
    Steven Kuo, Apr 8, 2005
    #2
    1. Advertising

  3. A. Sicken

    A. Sicken Guest

    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
     
    A. Sicken, Apr 8, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dietrich
    Replies:
    1
    Views:
    656
    Joe Smith
    Jul 22, 2004
  2. Geathaa
    Replies:
    2
    Views:
    714
    Geathaa
    Jul 30, 2003
  3. Leon
    Replies:
    2
    Views:
    546
  4. ectoplasm
    Replies:
    12
    Views:
    657
    Zorro
    Jul 28, 2005
  5. Dave
    Replies:
    5
    Views:
    708
    John Bokma
    Apr 26, 2011
Loading...

Share This Page