http://qs321.pair.com?node_id=869710


in reply to Re^5: typeglob/symbolic reference question
in thread typeglob/symbolic reference question

The difference is in the fact that '*' provides access to all of the slots and the '$', '&', '@' provide access to specific slot.

I understand "normal" typeglob syntax, i.e. that *color represents all variables with the name color. What I don't quite grasp is the syntax *{"color"}. Are the braces causing something to be dereferenced? Because as I understand it, when I write:

 @{"color"}

perl interprets that as an attempt to dereference a string. So perl treats the string "color" as a symbolic reference, which causes perl to go to the symbol table and look up "color", and the @ tells perl to grab what's in the ARRAY slot for "color".

Should I be interpreting:

*{"color"}

to mean: there is an attempt to dereference a string, so perl treats the string "color" as a symbolic reference and therefore perl looks up "color" in the symbol table. Then the * tells perl to create(?) a color typeglob? Or does the color typeglob already exist? I would like for the second choice to be true--for consistency, i.e. 'grab' something already there, rather than 'create' something.