in reply to use and performance

The best practice is to use all the modules you need in every module that needs them. There is no speed issue (perl only loads them the first time) and it serves as useful documentation.

Replies are listed 'Best First'.
Re: Re: use and performance
by educated_foo (Vicar) on Jun 10, 2003 at 15:25 UTC
    This isn't entirely true, since all those imports can really kill your script's startup time. If startup time's an issue, you should "use" modules only once, and just "require" them everywhere else. Equally good documentation, but less pain.

    /s

      I shudder to think how many imports it would take to make a dent in the startup time of a script on a modern computer. Most imports don't do anything at all.
        Class::Struct is an example of something that does a lot of work on import. This bites the prototype perl6 compiler pretty hard.

        /s