Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
What you want is a Template Engine. I am very fond of Template Toolkit, but there are many others. Just search CPAN for "template".
What you do is, you write the HTML page and replace the variable parts (where the output of your database query will go) with Template-Toolkit variables and then your CGI-script provide the data to the Template-Toolkit variables and you run the Template engine to combine both and output it to the browser. If you want to go one step further, explore the power of Web-frameworks such as Dancer or Catalyst where the templates and databases and all other important stuff (authentication, authorisation!) all come seamlessly together. CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James My blog: Imperial DeltronicsIn reply to Re: Integration of SQL Search Results Into An Existing HTML Template
by CountZero
|
|