in reply to Need help with CGI script that won't complete running

It is quite normal that you do not see a speed-up by using mod-perl. Mod-perl "compiles" your script the first time it is run (so the first time it is run it takes as long as a "normal" perl-script), and as from the second time it is run it uses the pre-compiled version, thus saving you the time to start a new perl-interpreter, loading in the program code and all modules needed, compiling the script and finally running it.

As you never even get around to run the script once and Apache kills it, mod-perl never gets a chance to show its usefulness.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

  • Comment on Re: Need help with CGI script that won't complete running

Replies are listed 'Best First'.
Re: Re: Need help with CGI script that won't complete running
by Vautrin (Hermit) on Jan 26, 2004 at 19:48 UTC

    I see. So I need to get the script running before mod_perl will be able to help? I don't suppose there is a way to compile a version running from the console, is there?

      Indeed, you will only see the speed-up the second time the script runs on that interpreter.

      As a rule your scripts should run under standard CGI before you try mod-perl as there are already enough pitfalls when using mod-perl, that you do not need the errors in your script on top of that.

      As a matter of fact, when you run your script from the console it does get compiled before it is run: but when the script ends Perl wipes it memory so next time you start afresh. Only mod-perl is able to "remember" the compiled script.

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law