| Next | Tricks of the Wizards | 61 |
Perl's standard Config module supplies a magical %Config hash
It appears to be full of information about Perl's configuration
use Config;
print "osname = $Config{osname}\n";
print "install module manuals into = $Config{installman3dir}\n";
osname = linux
install module manuals into = /usr/local/man/man3
Actually %Config is a tied hash
package Config;
...
@EXPORT = qw(%Config);
...
sub import {
...
*{"$callpkg\::Config"} = \%Config;
}
...
tie %Config, 'Config';
1;
"$callpkg\::Config" is equivalent to $callpkg . "::Config"
"$callpkg::Config" means something else
| Next | ![]() |
Copyright © 2003 M. J. Dominus |