in reply to Perl Object as Hash, Array & Scalar in the same time! ( $O->{k} | $O->[0] | $O )

I don't know any module that uses this, but I've seen globs as objects before (IIRC, some Net:: modules use globs too, but then to be able to use them as handles). I've done some proof of concept coding using globs as references to be able to do multi-inheritance where one class uses an arrayref, and another class uses a hashref. But that wasn't at all pretty.

And of course, one could always use pseudo-hashes.... ;-)

Abigail

  • Comment on Re: Perl Object as Hash, Array & Scalar in the same time! ( $O->{k} | $O->[0] | $O )

Replies are listed 'Best First'.
Re: Re: Perl Object as Hash, Array & Scalar in the same time! ( $O->{k} | $O->[0] | $O )
by gmpassos (Priest) on May 10, 2003 at 01:40 UTC
    ... Again (see my reply to PodMaster). You really need to access the data using GLOB, since you overload the normal acces for HASH, ARRAY and SCALAR in the same time!

    "some Net:: modules use globs too, but then to be able to use them as handles"

    Yes, I saw that, and was from there that I got the GLOB idea to fix the overload problem! ;-P

    Graciliano M. P.
    "The creativity is the expression of the liberty".