V
Veli-Pekka Tätilä
Hi,
I'd like to learn more about the various ways to access and use type globs
and how to deal with symbol table entries. Having started out with Perl 5.8,
I try to generaly stick to modern solutions such as references, exporter and
lexical file handles. Yet both type globs and symbol tables seem to pop up
in interesting places and appear somewhat related because symbol tables hold
globs and even some of the glob syntax looks like dereferencing to me. As
for usage, aliasing variable names like English does, creating truely
"weird" classses based on type globs, implementing callbacks using the
caller's package variables such as those in List::Util and installing new
subroutines (Memoize) or applying reflection come to mind.
Most books only briefly mention type globs and symbol tables, and even
Programming Perl has the information scattered in various places. Advanced
Perl Programming appears to have a whole chapter on the topic, number 3 that
is, but even so not all of the syntax such as *foo{thing} is covered, as far
as I can tell.
Frankly speaking I'm not happy with Perldoc's approach either. I've done
some digging and found bits and pieces here and there such as in perlmod,
perldata, perlref and perlsub. There's partial overlap in those docs and I
would describe the tone as: oh yeah, there are type globs, but I'm not sure
if you'll ever need them, and even if you do, we'll just quickly mention
them here to get to the more important stuff.
So are there any good books, tutorials or references that would fully cover
symbol tables and type globs, in particular, their usage in Perl 5? I'd
prefer on-line sources. Now that I'm here I'll also slip in another
question, howabout docs on the rest of the more obscure features that make
Perl perl such as formats and symbolic references under use strict 'vars'.
While not often needed, I'd like to read up more on those, too, and have a
feeling that I might have to maintain someone else's ancient Perl code some
day. Learning Perl doesn't cover formats any more, and most books deal with
symbolic references vaguely if at all.
PS: Is it a type glob or a typeglob or are both forms OK?
I'd like to learn more about the various ways to access and use type globs
and how to deal with symbol table entries. Having started out with Perl 5.8,
I try to generaly stick to modern solutions such as references, exporter and
lexical file handles. Yet both type globs and symbol tables seem to pop up
in interesting places and appear somewhat related because symbol tables hold
globs and even some of the glob syntax looks like dereferencing to me. As
for usage, aliasing variable names like English does, creating truely
"weird" classses based on type globs, implementing callbacks using the
caller's package variables such as those in List::Util and installing new
subroutines (Memoize) or applying reflection come to mind.
Most books only briefly mention type globs and symbol tables, and even
Programming Perl has the information scattered in various places. Advanced
Perl Programming appears to have a whole chapter on the topic, number 3 that
is, but even so not all of the syntax such as *foo{thing} is covered, as far
as I can tell.
Frankly speaking I'm not happy with Perldoc's approach either. I've done
some digging and found bits and pieces here and there such as in perlmod,
perldata, perlref and perlsub. There's partial overlap in those docs and I
would describe the tone as: oh yeah, there are type globs, but I'm not sure
if you'll ever need them, and even if you do, we'll just quickly mention
them here to get to the more important stuff.
So are there any good books, tutorials or references that would fully cover
symbol tables and type globs, in particular, their usage in Perl 5? I'd
prefer on-line sources. Now that I'm here I'll also slip in another
question, howabout docs on the rest of the more obscure features that make
Perl perl such as formats and symbolic references under use strict 'vars'.
While not often needed, I'd like to read up more on those, too, and have a
feeling that I might have to maintain someone else's ancient Perl code some
day. Learning Perl doesn't cover formats any more, and most books deal with
symbolic references vaguely if at all.
PS: Is it a type glob or a typeglob or are both forms OK?