in reply to Re: Website Application Framework with Sybase, Apache & Perl: My Thoughts
in thread Website Application Framework with Sybase, Apache & Perl: My Thoughts

If your memory use bothers you, you can either fork, require Foo::Bar, exit or write a Perl script that uses the module in question and pipe through it - depending on which of either is more convenient in the case at hand.
How does require result in memory savings over a used module? I don't think it does, as a use is converted into a BEGIN {require }

Carter's compass: I know I'm on the right track when by deleting something, I'm adding functionality

Replies are listed 'Best First'.
Re^3: Website Application Framework with Sybase, Apache & Perl: My Thoughts
by Aristotle (Chancellor) on Dec 19, 2002 at 20:26 UTC

    Yes, require happens at runtime - that's why I said fork first. Only the child loads the module to do the deed and then exits, so the parent process doesn't acquire any bloat.

    (Not that I'm entirely convinced that loading modules per se costs a lot of space - more likely it is accumulated data structures that cause the Perl process to grow exorbitantly. That's mainly a matter of scoping stuff closely, and otherwise being attentive.)

    Makeshifts last the longest.

Re: Re: Re: Website Application Framework with Sybase, Apache & Perl: My Thoughts
by djantzen (Priest) on Dec 19, 2002 at 20:21 UTC

    I think Aristotle's point is to load the module in a forked process so that it's dumped when that process exits.