in reply to Need help separating logic from display
Hi,
I have previously developed a system for workflow colloboration for my previous employer, wherein I tried to achieve the same goal of separting the GUI (HTML content) from the business process logic. I did not use any modules like HTML::Template but however I just cached all the html files with place holders (templates) into a hash. The names of the templates and their filenames including path are associated/driven by a parameter file. The names serve as the keys for the hash and the html content as value. The html content is populated with place holders like #customer_name# etc. The only problem is where a table with multiple rows of data to be populated typically with some values coming from a database. In these cases the html code defining the row itself is made a template and the main template file holds a place holder of this template name. While using mod_perl, I have loaded the hash in the startup.pl code so that there exists only one copy of this hash for all instances of webserver processes. To simplify remembering the place holders, you may like to use the same names of the fields/columns in the database table, but however these are validated for spurious code before loading into the hash.
This scheme has worked well for me and the response time will be very good as there is no need to read any html files for each query, as all the templates are in memory. Except for the place holder tags the templates are free from any embedded code. The server side logic is clean as it is devoid of any content generating code (html related stuff) and the logic is easy to comprehend. This scheme has worked well for me and you may like to try the same.
Hope that helps.
Thanks
babumovva