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

[..] large programs often have a huge memory overhead because modules cannot be unloaded after use. In contrast, Unix shell pipelines enter memory, do their job, then exit.

I don't buy it. These issues are entirely orthogonal.

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.

You're making the same mistake as people who compare JSP with CGI scripts written in Perl and conclude that Java is better. What matters is the environment, not the language.

Makeshifts last the longest.

  • Comment on Re: Website Application Framework with Sybase, Apache & Perl: My Thoughts

Replies are listed 'Best First'.
Re: Re: Website Application Framework with Sybase, Apache & Perl: My Thoughts
by princepawn (Parson) on Dec 19, 2002 at 20:11 UTC
    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

      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.

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