-----Original Message-----
>From: Enjoy_Life <[EMAIL PROTECTED]>
>Sent: Jan 24, 2008 12:13 AM
>To: Jeff Pang <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>Subject: Re: question about typeglob
>
>thanks to your quickly answer.
>
>now, i know :
>>>'foo' is a key in symbol table,whose corresponding value is *foo.
>is *foo itself a hash too?  

No,it's just a glob.
*foo{HASH} means a hash.
*foo{PACKAGE} means the current package.
*foo{SCALAR} means a scalar.
*foo{ARRAY} means an array,etc.


>*foo{SCALAR},*foo{ARRAY}...are reference to
>$foo, @foo,....
>is that right?

Yes. can give a test:

$ perl -le 'our $foo="abc";print  ${*foo{SCALAR}}'
abc

$ perl -le 'our @foo=(1,2,3);print  @{*foo{ARRAY}}' 
123

>
>and i want to know why  *foo == *{*foo}.
>

As John said, this is the way perl works.
Actually symbol table is not so much worthy to research in this day.
Even if you write advanced perl module you don't need to know much about it.
I paid some time to study it when I researched modperl and the XS,but I never 
used it.


Regards,
Jeff Pang

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to