[Israel.pm] use and require

sawyer x xsawyerx at gmail.com
Sun Mar 13 03:45:19 PDT 2011

On Sun, Mar 13, 2011 at 12:40 PM, Shmuel Fomberg <owner at semuel.co.il> wrote:

> Whenever I see 'require' used instead of 'use', I expect problems in the
> module-dependency tree.
> What do you think?

I think there are benefits to both. It depends, as always, on your needs.

If you have a healthy build process, you can use "require" instead of "use"
when you want to allow some features to be lazy, and that's very useful. You
can also allow loading two different versions of the same mechanism,
depending on some logic. If you have this, load that one, if not, load this
one. Imagine Mouse only uses Moose if it's already loaded, saving you a ton
on compile-time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20110313/270e7400/attachment.htm 

More information about the Perl mailing list