SPUG: Interdependance of package subroutines
DeRykus, Charles E
charles.e.derykus at boeing.com
Thu May 19 14:12:23 PDT 2005
>... This is were I found the real use of "require" instead of "use".
Because, I wouldn't know if a user
> really needed to use a schedule C or not until further into the
application. Perl will only compile a
> required file at time of use and not before. So if they never ended up
using this required file, it
> would never be called or compiled.
A seemingly underused alternative to require is the autouse pragma
which'll
defer loading until used:
use autouse Mail::Mailer; # mail only if errors
I tend to prefer autouse for visibility with all 'use' keywords at the
top.
Rgds,
--
Charles DeRykus
More information about the spug-list
mailing list