Shenpen has asked for the
wisdom of the Perl Monks concerning the following question:
after reading the CGI.pm documentation, my problem is that I think this module was created with the concept in mind that programmers create web pages (via hand-typed code). IMHO programmers should not create web pages, because 1) webdesigners have to make a living to :-) 2) it will be ugly 3) the programmer will constantly be harassed to make it prettier and programmers usually hate both to be harassed and to make cosmetical modifications to anything.
So my approach to web programming would be to:
1) have a webdesigner create a web page with a WYSIWYG editor
2) let's take this pretty web page and insert special tags in it for the dynamic, CGI-generated content
3) write a simple Perl CGI program that reads this HTML file line by line, if does not find special tags the simply writes it to STDOUT (to the web server), and if it finds, then does something special.
For example, if the program encounters a !!put:'any perl code or expression'!! tag, then it would eval() the expression or the code (if it's code, it should end with return, of course), and writes the result. More tags can be made for non-printing code, or to print something with an iteration (tables, reports, besides CGI, this stuff could be used to create HTML-based reports, even business documents like invoices), etc.
It's very easy, I'm almost done with it, except for the iteration stuff, that seems to be fairly hard (the basic logic is that a section of the HTML file should be repeated while the code in the special tag returns a defined value).
But isn't there a module for it? It's so simple that I'm sure someone invented it long ago.