It was why they are structs with a bunch of pointers to different things
Perl can have arrays, scalars, hashes, etc with the same name. Therefore, the symbol table entry for a name must be able to hold all of them.
I don't think that too many people actually do that, am I wrong?
It doesn't matter how many do. It just matters if they can. That said, virtually every program uses both $_ and @_. The numerous programs using <> use $ARGV, @ARGV and *ARGV{IO}.
| [reply] [d/l] [select] |
I thought about it some more, and it appears that efficiency can't be the reason. I don't see why symbol tables even need to have any structs (as opposed to just bare pointers). Judging by the header you provided, the glob doesn't actually do much of anything, other that being a collection of pointers. So it was "Larry's idea" then, I guess :)
| [reply] |
You can e.g. assign a typeglob to another:
$foo = 42; @foo = ( 1, 2, 3 );
*bar = *foo;
print "$bar @bar";
undef *bar;
print "$bar @bar";
Where and why that might come useful I cannot tell; however, it does make sense to keep a single struct, does it not?
| [reply] [d/l] |