in reply to understanding my() and typeglobs

  1. Variables on the pad are not related. A package global $foo and @foo would be synonyms for ${*foo{SCALAR}} and @{*foo{ARRAY}}. On the pad, there's no glob; there's just a scalar referenced by the name $foo (including sigil) and an array referenced by the name @foo (again including sigil).

  2. Whatever floats your boat. If they're the most natural representation - go for it.

Btw, why copypaste code from Symbol rather than use the module itself?

Update/disclaimer: I may be wrong with respect to how the pad works, though the information given is to the best of my knowledg. In the interests of accuracy, following my posting this, I went to research whether this was all really correct. So far I come back empty handed. My fiddling with PadWalker supports the knowledge purported above, but that may not necessarily mean anything. If I'm wrong, please do correct me.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: understanding my() and typeglobs
by Ctrl-z (Friar) on Mar 16, 2003 at 15:49 UTC
    thanks. the emphasis on "including sigil" seems intriguing...

    btw, the tradeoff of a couple of keystrokes, for understanding a concept and controlling how it is implemented is worth the effort, IMHO. And in the context of a post related to symbols and lexicals, return bless gensym leaves a lot implied to the reader.


    time was, I could move my arms like a bird and...