Sandboxing class modules with instances of a CGI script
Mark Knoop
mark at rawcane.net
Wed Jan 30 00:46:20 GMT 2008
Hi
I'm new here but you guys seem more open to abstract type questions than
some of the other lists I'm subscribed to so thought I would run this past
you. I have been programming in Perl for a while but only recently made a
concerted effort to start doing things properly and improving my old
techniques and learning some new ones (out of which OO design is one area
that I am just getting familiar with).
I am deploying lots of similar sites (generated progammatically from config
and templates) that all use a similar CGI script to serve the pages and
content and perform certain functionality that is common among all the
sites. Rather than have one instance of the script which deals with all the
sites I felt it was safer to create a new instance for each site so that I
don't risk breaking one of the other sites if I change the CGI script. I can
then regenerate other sites with the newer CGI script at my leisure testing
each one if necessary before deploying it. This works fine if I have one
massive CGI script but this is what I want to get away from.
If I am going to tidy up my code by splitting things up into class modules
then I am in a dilemma as to whether to have lots of different versions of
the modules or whether to centralise my class code and risk breaking
something somewhere that I may not pick easily be able to pick up on
whenever I update the modules. If I go for the former do I just put the
modules next to the CGI script somewhere in the site directory structure or
is there a tidy way to have multiple versions in my lib path and require a
specific version from each CGI instance?
Is this a familiar situation? Any best practice suggestions? Am I
approaching it in entirely the wrong way?
Any sounding board input gratefully received...
Cheers
Mark
More information about the london.pm
mailing list