I'm looking at converting a large CGI installation over to mod_perl. 
The code is clean, so moving it to Apache::Registry isn't causing any
problems, but I'd like to get the most bang out of the conversion that I
can.

Currently the code is a set of scripts that all call modules that are
subclasses of a local subclass of CGI::Application (I realize the
subclassing is hitting our efficency, but it's deemed worthwhile for the
advantages it brings).  These modules have run-modes as per standard
CGI::App, and return to CGI::App a scalar ref of HTML, which CGI::App
outputs with the appropriate headers via CGI.pm.  The scalar ref our
modules return are content files processed through a Template Toolkit
template.  

I'm seeing the following potential areas of speed improvements:

- CGI::App could be altered to use Apache::Request.  I haven't looked
into the code yet, but I recall from previous scans that it isn't overly
complex (the beauty is in the simplicity, after all), so if the
efficiency is worth it, and if CGI::App can't be easily coaxed into it,
I should be able to fork my own to do Apache::Request.  Of course, I'm
doubtless not the first to consider this, so has someone already
invented this wheel?

- My Template Toolkit object could be reused, along the lines of
Apache::DBI. (Since that object isn't changed in any session, just
processes some data and returns a result). Sadly, I'm not clear on how
to do this.  Apache::Template is a handler in it's own right, so it
won't do what I seek.  Should I jump into Apache::DBI to see how it does
it, or is there some documentation on how to create persistant objects
that survive between connections?  [Actually, I want more than a
persistant TT2 object, since I have a wrapper module that has some
helpful interface routines, so I'd want that to be persistant as well.]

I've looked at perl.apache.org and skimmed the eagle book without
finding this, but it is a bit specific, so I could have missed it. 
Thanks in advance for any help.

Reply via email to