in reply to Multiple template coordination using HTML::Template

You should look into CGI::Application, which tightly integrates HTML::Template into its core. Basically, with CGI::Application, each of your "faces" would be a runmode, and then your application has a "setup" method that helps define the flow of your application. Looking at the "setup" subroutine of a app built with CGI::Application, you can usually figure out what each "face" or runmode does.

The other advantage is the CGI::Application is a gentle introduction to OOP. You can easily create a "superclass" that holds methods that you share among different modules of your application- you might split your report functions from your file list functions, but you can then share methods among them simply via the superclass.

There are a lot of advantages to using this module- it forces you to code cleanly, you can easily change the functionality and templates used for an entire application without recoding, and it's mod_perl friendly, should your application ever reach that level.

Check it out!

-Any sufficiently advanced technology is
indistinguishable from doubletalk.

  • Comment on Re: Multiple template coordination using HTML::Template

Replies are listed 'Best First'.
Re: Re: Multiple template coordination using HTML::Template
by ryan (Pilgrim) on Dec 30, 2001 at 06:49 UTC
    Thanks for the guidance monks. I have just had a quick look at the concept of CGI::Application and it certainly looks like a winner for my purposes. Anything that forces me to design things properly is good in my book. Of course code-reuse remains at the will of my power to program it as such, but the potential is there. The program is already running under mod_perl which then made me look at Apache::Session which may have some advantages for me also.

    All in a day's wide-eyed learning ... Ryan