The symbol table consists of a hierarchy of globs. A glob, short for typeglob, is a structure that has a slot for each variable type supported by Perl (and a few more). By using a glob for each symbol in the symbol table, we can have variable of each type with the same name.
- Scalar ($foo)
- Array (@foo)
- Hash (%foo)
- Sub (&foo)
- File handle
- Dir handle
- Format
- etc
$ftp is expected to be a glob. (Probably so it can be used as a file handle.)
${*$ftp}{net_ftp_host}
can also be written as
$ftp->**->{net_ftp_host}
which is equivalent to
$ftp->*{HASH}->{net_ftp_host}
But it's not equivalent to
$ftp->{net_ftp_host} # XXX
The program is accessing the HASH slot of the glob, which contains a reference to a hash with the object's attributes.
|