On Tue, Jan 15, 2008 at 09:13:19PM -0800, Darren New wrote:
Mark Schoonover wrote:
Perl has references, but I'm not exactly sure if they're just like C
pointers.
I understood them to be more like "pass by name" than pointers per se.
I.e., more like in Tcl putting the name of a variable in a string. I could
be wrong, but I thought the reference was a reference to a variable rather
than a value.
Perl has name references, too. To quote the manual:
Symbol tables entries can be named with an initial '*', but you don't
really care about that yet (if ever :-).
...
Perl uses an internal type called a typeglob to hold an entire symbol
table entry. The type prefix of a typeglob is a "*", because it
represents all types. This used to be the preferred way to pass arrays
and hashes by reference into a function, but now that we have real
references, this is seldom needed.
It could be used for some strange tricks before references existed, but it
really isn't all that useful.
Dave
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg