But for your particular situation dhoss there is a plugin from Mark Stosberg, CGI::Application::Plugin::DBH which puts the database initialisation in the cgiapp_init method. It even uses lazy loading so that if it is not required within a runmode the connection to the database is not made, thus saving time and bandwidth.
samtregar also makes the very useful suggestion of using <tmpl_include ..> directives in templates, this is very useful. But don't forget to ponder the use of <tmpl_if ..> and <tmpl_unless ..> directives. Although coming dangerously close to incorporating code in the HTML, they do allow a very simple, and easily managed, method of controlling presentation of menues.
Having said all of that, CGI::Application works best in a mod_perl environment when it gets to big applications. But that's the subject of another whole thread I think.
In reply to Re^2: Breaking up a CGI::Application program
by jdtoronto
in thread Breaking up a CGI::Application program
by debiandude
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |