in reply to All-in-one script vs independent scripts

I was pondering this same thing 5 years ago. Don't make the mistake I made - I went with the all-in-one script. Bad idea. Now I'm stuck with a script that's about 5000 lines long, and perl needs to read and compile all of those lines for every single request to the server. This is not as big of a deal if you're running under mod_perl, but in a CGI environment, bad, bad idea.

Make your scripts do one thing, and do them well. I'm just starting to get into working with HTML::Mason (which rocks!), and I'm starting to learn that it's even a good idea to seperate the script that displays the form from the script the processes the results!

So my advice (which you did ask for! :), is to make your scripts small, focused and therefor easy to maintain. The end user doesn't need to know it's not all under one über script - the details can be hidden with redirects.

Hope that helps!

-- zigdon

  • Comment on (z) Re: All-in-one script vs independent scripts