in reply to RE: Re: Formatting CGI
in thread Formatting CGI

It doesn't work right because you shouldn't be print-ing the submit buttons; the submit method (as well as the other HTML methods in CGI.pm) *returns* the HTML, so you should just take the print statements out, and it should work just fine.
th([ submit(-name=>'action', -value=>'whatever'),
and so on.

By the way, you don't *have* to use the CGI.pm methods if you don't want to, or if you're more comfortable just printing out HTML. Personally, I've never found much of a use for them.

As Abigail wrote: "CGI.pm's set of methods that output html tags seems to me as useful as an English.pm module with a method for every word, and using that instead of writing plain text."

Replies are listed 'Best First'.
RE: RE: RE: Re: Formatting CGI
by Anonymous Monk on Apr 07, 2000 at 00:36 UTC
    Imagine that, after being slapped around a bit by Guy Steele, the W3C announces that, effective immediately, the official format for HTML is no longer
    -HTML- -HEAD- -TITLE-Bla-/TITLE- -/HEAD- -BODY- -IMG src="foo.bar"- -/BODY- -/HTML- -/CODE- (think &lt;&gt; instead of --), but instead <CODE> (in-html (cons (in-head (in-title "Bla")) (cons (in-body (img :source +"foo.bar")) '()))
    . Imagine also that, at the very same time, both AOL/Netscape and Microsoft have signed treaties promising that they'll follow the W3C specs by the letter. Now, if you've got a shitload of code floating around which extensively uses literal HTML (be it quoted, with here-docs, or using the __DATA__ facility), you're going to have a lot of editing to do... (and just try to cook up an HTML-to-SEXP translator script!). Whereas if you're using the CGI module's facilities, all you have to do is change a few functions here and there, and you're all set - and your CGI programs will be the only ones that work with the newest releases of Nutscrape and Exploder!