in reply to Re: Re: Object::MultiType - Perl Objects as Hash, Array & Scalar in the same time!
in thread Object::MultiType - Perl Objects as Hash, Array & Scalar in the same time!

As I recall, you can't handle globs this way and expect to get unique ones. As I recall localizing a symbol table entry and returning a reference will cause multiple uses to merge into a single shared instance. You still need to use gemsym() or my lexglob() for handling that $this->{g} instance.

sub new { my $class = shift ; local(*NULL); my $this = { s => \'' , a => [] , h => [] , c => sub{} , g => \*NULL , } ; bless($this,$class); return( $this ) ; }
  • Comment on Re: Re: Re: Object::MultiType - Perl Objects as Hash, Array & Scalar in the same time!
  • Select or Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Object::MultiType - Perl Objects as Hash, Array & Scalar in the same time!
by gmpassos (Priest) on May 12, 2003 at 18:44 UTC
    The *NULL is not a GLOB to be used by the user! It's just here to avoid erros!

    If the user want a glob it need to paste it:

    my $obj = Object::MultiType->new(glob => \*MYGLOB) ;
    Will add some note in the POD! ;-P

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