Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by zigdon (Deacon)
on Dec 31, 2003 at 13:59 UTC ( [id://317883]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://317883]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found