Fratres reverendissimi,

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.

Servus humilis,

Shenpen

In reply to A different approach to CGI by Shenpen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.