sub import {
no strict 'refs';
for (qw(filename basename fileparse)) {
*{"main::$_"} = \&$_;
}
}
Boy, is that cryptic! And limited. What if you
didn't want fileparse? What if
you invoked use in a package other than
main?
Thankfully, there's a standard
import that's available in the
Exporter module. As the module author, all you do
is add:
use Exporter;
our @ISA = qw(Exporter);