Sandboxing class modules with instances of a CGI script

Jonathan Stowe jns at
Wed Jan 30 09:57:24 GMT 2008

On Wed, 2008-01-30 at 00:46 +0000, Mark Knoop wrote:


> 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?

As Andy said a single set of installed modules with the best test suite
you can come up with is the way to go.  Having multiple copies of
supposedly similar code is at best a management nightmare and is
guaranteed to help proliferate bugs rather than avoid them.

If you find that you need slightly different things in different
implementations of the application then structure your design so that
you have the core common functionality in classes that are easily
sub-classable where necessary.


More information about the mailing list