in reply to Re: CGI and XHTML
in thread CGI and XHTML

Well I used to use here documents as I think most people probably do, but after seeing so many articles of the 'you should be using cgi, no really...' kind, I started using it to produce the html too.

In fact, I've grown to like the syntax, and I love how long winded checkbox groups, select boxes and the like can be created with one line and a hash. It really seems to reduce the code involved, and make the process a lot quicker, but I guess if one isn't used to the syntax, it can be quite hard to read.

I'm not sure about templates. Surely you still have to write the code for all different types of code, which could be done with here docs anyway?

PS. I now have cgi 3.04. Never thought to check that, I just assumed I had the latest port for some reason. Seems to work well.

Replies are listed 'Best First'.
Re: Re: Re: CGI and XHTML
by BUU (Prior) on Apr 13, 2004 at 23:25 UTC
    The real point of templates, and to a much lesser extent heredocs, isn't to reduce the work involved in creating the html in the first place (although it can). The real point is to seperate code and presentation. The html is the presentation, the perl is the code. Seperating them has many benefits, most of which have been listed elsewhere before.