in reply to Is there a problem with how large the perl file gets?

Since Perl code is compiled every time it is run, the startup time for a very long script is quite a while. Running it under mod_perl is a solution for that, since it will only compile it once, when Apache starts. Splitting it up into several smaller files won't help, though it may make your script more maintainable.

If the runtime isn't mostly spent doing compilation, try using Devel::Profile to see what parts of your code are taking up most of the time, and see if you can speed them up.

Good luck!

Replies are listed 'Best First'.
Re^2: Is there a problem with how large the perl file gets?
by friedo (Prior) on Feb 24, 2005 at 13:14 UTC
    Splitting it up into several smaller files won't help, though it may make your script more maintainable.

    It can help, if certain functions of the CGI are used more often than others. Splitting those off into a much smaller script will mean faster overall access times for the system as a whole.

    That's just a band-aid, of course. Something like mod_perl is definitely the way to go in the long term.

      Splitting those off into a much smaller script will mean faster overall access times for the system as a whole.

      Agreed. I meant that simply chopping one big script into several modules then useing or requireing all of them wouldn't speed anything up.