Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I guess, your confusion comes from the presence of GLOB slot in the symbol table entry described in the book. In reality, the syntax *{"color"} references the symbol table entry as a whole, not the GLOB slot of it. When you assign some reference to this entry, then perl copies the reference into appropriate slot of the symbol table (type of reference defines which slot is taken).

The GLOB slot of symbol table entry mentioned in the perlref is something obscure. It is not reported by the Devel::Peek module. I guess, that this is just a syntax sugar. One can do either $a = \*other; or $a = *other{GLOB}; and both shall return the reference to the symbol entry as a whole. This reference can be used for reading files and doing something like *{$$a} = \$b; to alias $other with $b.

Reference to the symbol entry is not the same as an "alias" for the symbol entry. You can do $a = *other; here $a shall become alias of the symbol entry and you can say ${$a}[0] = 2; or ${$a}{key} = 3; or <$a> to read the file. All of this will actually use @other or %other etc. Effectively, it is an alternative to using references.

In reply to Re^3: typeglob/symbolic reference question by andal
in thread typeglob/symbolic reference question by 7stud

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (1)
As of 2021-10-28 15:09 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (96 votes). Check out past polls.