in reply to Re: Building large Web sites
in thread Building large Web sites

We can't use mod_perl because we use ISAPI and IIS. I don't have any choice in that.

I'm not sure if you answered my main question. You said number of pages isn't important, but amount of traffic. What I was wondering is whether or not it is a good idea to break one script down into a bunch of smaller scripts, with the main script 'requiring' the smaller scripts as needed (one script per screen). The pro seems to be that smaller amounts of Perl are loaded. The con seems to be many more scripts. Sorry if my question was not clear.

Replies are listed 'Best First'.
Re: Re: Re: Building large Web sites
by swiftone (Curate) on Jun 11, 2001 at 20:37 UTC
    Sorry I missed that ISAPI part.

    THe comment about number of pages vs traffic was changing the definition of "large websites". If you are more concerned about the number of pages you have to maintain, here's my advice (My sites haven't had more than 350 pages, although those were doubled up in text and graphic versions to near 700, so take this advice with the appropriate amount of salt).

    Rather than break it down into smaller scripts, Move as much code as you can into modules. If something shows up in more than one script, it's worth modularizing (this is basically what you were saying, but modules are cleaner than scripts, you aren't trampling the same namespace).

    If you break your HTML away from your Perl code, you can reduce your HTML maintenance requirements, and can have non-coders write HTML. This is what the templating systems are for.

    Since you don't have mod_perl, I'd suggest looking into HTML::Template. CGI::Application could help you, because it can let you reuse the same code for multiple scripts, but it isn't essential.

    Really I think you have the right idea, but if you Modularize your code, it will be cleaner. More modules can be easier to maintain than fewer but longer scripts, because you don't have to worry about trampling namespaces, and the purpose of the code is more clear-cut.

    Hope that helps.