stevieb has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a module (package), and I need to use another module, but not until a specific subroutine gets called (in this case, a sub that *always* is called). use is executed at compile-time, so where in a sub-only (ie. non-executable) module is the best place to require/include ie. use this external module?
Is it wise to put the use at the top of the module so it is clearly visible upon first glance, or in the sub that needs it so it's identified that we need it here while reviewing the code?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Where in a package should 'use' be called?
by davido (Cardinal) on Sep 28, 2015 at 02:58 UTC | |
|
Re: Where in a package should 'use' be called?
by u65 (Chaplain) on Sep 28, 2015 at 00:26 UTC | |
by stevieb (Canon) on Sep 28, 2015 at 00:42 UTC | |
|
Re: Where in a package should 'use' be called?
by Anonymous Monk on Sep 28, 2015 at 11:50 UTC |