in reply to Re: Re: Perl Object as Hash, Array & Scalar in the same time! ( $O->{k} | $O->[0] | $O )
in thread Perl Object as Hash, Array & Scalar in the same time! ( $O->{k} | $O->[0] | $O )
No, clearly every gensym object occupies a new GEN# slot in the Symbol package. Also - DESTROY is completely innappropriate here. You cannot call ->DESTROY on an object and have it actually free the object. The ->DESTROY method is called by perl when the object is being destroyed - you can't provoke it by calling it yourself.
perl -MB -MSymbol -e '$,=$\="\n";push @A,gensym for 0 .. 10;@B=map B::svref_2object($_), @A; print $_->STASH->NAME."::".$_->NAME for @B'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: 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 02:56 UTC |