[Catalyst] 'require' vs 'use' in Catalyst*
Joel Bernstein
joel at fysh.org
Thu Aug 10 19:37:06 CEST 2006
On Thu, Aug 10, 2006 at 10:28:47AM -0700, Rodney Broom wrote:
> Disliking the fact that require() doesn't call my import(), I'm trying to figure out why Catalyst (and so many other things) use require() over use(). I have to think there's a good reason that just isn't occuring to me.
require is runtime, use is compile-time.
Perl doesn't know at compile-time which plugins you're going to load.
That's why require is necessary.
In any case, use Foo is exactly equivalent to:
require Foo; Foo->import();
/joel
More information about the Catalyst
mailing list