> > In practical daily use, use(); is preferred as since it compiles the > > module as soon as it sees 'use Foo::Bar;' before moving on, this will > > catch errors and scope conflicts far sooner than if you use require(); > > There aren't many good reasons to use require, at least I > > can't think of > > any. When in doubt, use use(); :) > > > > If you see a lot of 'requires' in subroutines, I suspect someone just > > didn't get scope or wrote a quick hack so performance is the > > least of the > > codes worries. > > require() is handy inside an eval { } block to trap whether a module > is installed or not. Many CPAN modules use this technique.
Very occasionally I will also do something like this: my $needed_file = deduce_where_necessary_code_is(); require "$needed_file"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]