--- Peter Scott <[EMAIL PROTECTED]> wrote:
> It's always seemed to me that the 'approved' way of creating modules
> to import routines into another script was a bit wordy.
> In a nutshell, you have to do something like
>
> package abc;
> use Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw(foo bar baz);
> @EXPORT_OK = qw(blech flurble);
>
> sub foo { ... }
>
> And that's not even with proper strictness enabled.
But you don't *have* to do any of that.
Exporter is often only use to pollute the main package namespace.
It's an awesome module, but almost never something you *have* to use.
You can always just specify the namespace where the functions reside.
That said, I might agree that require is a better mechanism in many
cases, but when I first started looking for ways to modularize my code,
I looked at require in perlfunc and saw:
"For a yet-more-powerful import facility, see use and perlmod."
Being too much the gearhead, I went straight there and have virtually
never used a require statement in a script.
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/