in reply to Use and Require - making an informed choice.

Does the module need to be imported at compile time (i.e. does it rely on using BEGIN)?
Remove "(i.e. does it rely on using BEGIN)" as it isn't a factor.
  • Comment on Re: Use and Require - making an informed choice.

Replies are listed 'Best First'.
Re^2: Use and Require - making an informed choice.
by xdg (Monsignor) on Jan 30, 2006 at 15:33 UTC

    The fact that a use creates a BEGIN block can matter if order of compilation is important. That's substantially different from a runtime require and import without the BEGIN. For example: importing a function that overrides a built-in. If requiring and installing a subroutine at runtime, the compiler will already have resolved calls to the built-in functions at compile time before the replacement functions are installed.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.