>>>>> "ro" == robb@acm org <> writes:
ro> Test Scripts
those are executables so should be in some bin/ dir. they don't need to
be in any cgi areas (unless they are cgi driven). in fact i wouldn't put
any development source in the actual cgi dirs. copy tested scripts into
cgi dirs using an install process.
ro> Application CGI scripts, referenced directly from a web client
in many cases those can be reduced to minimal or even reused scripts
that call out to modules that do all the work. this is a very good way
to do this because the modules will have a clean perl API which can be
called from standalone test scripts. the cgi scripts become trival
wrappers which grab the cgi params (using CGI.pm or mod_perl), mung the
data into the form the modules want (hash trees, etc.) and call out
to the proper modules. the results are processed into html output
(possibly using a templater) and that can be also done in external
modules. then the cgi is even simpler and it can almost be made into a
common script that can do many operations based on its name (check $0 as
a primary dispatch arg) or a command type param.
with these modules you can develop them anywhere you want. use lib can
help you find and load them from the proper installed dirs (or you can
install them in perl's default lib dirs). you can put the test script
development near the modules that they test which is good too.
ro> I'm definitely interested in removing things from cgi-bin that don't
ro> need to be there. And, I want to increase maintainability. I also
ro> want to enable automated running of all my tests.
what needs to be in cgi-bin is a minimal set of cgi scripts which just
call out to modules that do the real work. this makes your cgi very
clean and easy to manage. consider cgi as just an interface to your
modules and design your code accordingly. interfaces should be isolated
from back end work so you can more easily have multiple interfaces
(think cgi and test scripts as using two different interfaces).
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org