Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Why does Perl have typeglobs?

by RonW (Parson)
on Jul 08, 2014 at 19:39 UTC ( [id://1092779]=note: print w/replies, xml ) Need Help??


in reply to Why does Perl have typeglobs?

Actually, typeglobs are more like structures than unions. Symbol table entries have a name field plus a value field for each type of value.

As for why the Perl symbol table was designed this way, my guess is that it was just easier to manage only one entry per name and, similarly, only one symbol table per package.

Personally, I think it would have been simpler to only allow a given symbol to be one type of value, that of its first use. Since this is in line with best coding practices, it would have been a reasonable design choice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1092779]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-25 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found