Jeff Westman wrote:

> Hello All,
> 
> I have a trivial question.  I have a perl script, with several
> sub-routines.
> In one of those routines, I currently have listed 'use Date::Calc'.  So
> that package is therefore only available (and needed) in that one
> sub-routine.
> 
> My question is, should all 'use' statements be placed at the top of the
> script, or only in routines that need them?
> 
> 
> -Jeff


If there's a chance that the script in question will NOT have to call on 
this module, you can use the 

        use autouse 'Date::Calc';

pragma.

I sometimes do this with Carp, for instances where I don't expect carp to 
get called very often, in those instances it won't load unless it's needed. 

        use autouse 'Carp' => qw(carp croak);

Otherwise I generally place all module usage at the top so they are easy to 
find for future maintainers. 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to