Jan 1, 2001, 7:58 AM
Post #2 of 2
The use compile-time directive is like calling require(), but: a) it happens at compile-time, b) it also calls the import() method of the module, if it exists, and c) it only works with modules (files ending in .pm).
It's used like so:
The import() method allows you to access specific parts of the module to be copied into your program, instead of having to access them from the module's namespace. Some modules import things automatically.
use Some::Module; # the file is Some/Module.pm
use Foobar 'blat'; # the file is Foobar.pm
# are like
To learn more about modules, please read perldoc perlmod.
Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author