I think you lost the context. My question is not whether %$$self and
%$self are same ( They are not and this was never a point of debate ). I
wanted just the explanation of using %$$self in the *** context of ***
autovivifying typeglobs. What I really don't understand is how to
interpret the %$$self ( or @$$self etc. ),
w.r.t. typeglobs. I tried to fathom it by reading the Camel but somehow
miss the obvious (: if it is :)
regards,
-------- Atul
Michael Fowler <[EMAIL PROTECTED]>
09/19/01 06:35 PM
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject: Re: autovivification of typeglobs
On Wed, Sep 19, 2001 at 12:07:16PM -0500, [EMAIL PROTECTED] wrote:
> Thanks for the answer but what I want to know is the meaning of %$$self.
I
> understand autovivification ( data structures spring into existence ).
> However, the part I don't understand is %$$self. Shouldn't it be %$self?
I haven't been following this conversation very closely, but if you're
asking if %$$self and %$self are the same, they aren't. Given %$$val1 and
%$val2, $val1 is a reference to a scalar, which contains a reference to a
hash; $val2 is a reference to a hash. Attempting to dereference $val2 as
%$$val2 would get you fatal error; try it.
$val1 = \{};
$val2 = {};
print %$$val2;
> (By the definition, you can always put a reference in place of the
> literal in the variable. i.e. $self{k} and $$reftoself{k}. Replacing
> "self" with "$reftoself" is equivalent.
I suppose, in concept, that's correct. However, it's incorrect to refer
to
$self as a literal, or to $self without its qualifying sigil. The symbol
'self' is very different from the scalar $self.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]