Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 22045
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: Modernize XHTML output in SYNOPSIS
The example in the CGI.pm SYNOPSIS almost creates a valid XHTML document. Almost, it's only a 'print end_html;' at the end missing. Then I suggest to replace the old-fashioned (and probably wrong) "texta", "textb", p coding style by using <div>s: div("texta", "textb"). So the generation of the form should probably look like this: div("What's your name? ",textfield('name')), div("What's the combination?"), div(checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','minie'])), div("What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse'])), Regards, Slaven
On Thu Oct 12 05:10:41 2006, SREZIC wrote: Show quoted text
> The example in the CGI.pm SYNOPSIS almost creates a valid XHTML > document. Almost, it's only a 'print end_html;' at the end missing. > > Then I suggest to replace the old-fashioned (and probably wrong) > "texta", "textb", p coding style by using <div>s: div("texta", "textb"). > So the generation of the form should probably look like this: > > div("What's your name? ",textfield('name')), > div("What's the combination?"), > div(checkbox_group(-name=>'words', > -values=>['eenie','meenie','minie','moe'], > -defaults=>['eenie','minie'])), > div("What's your favorite color? ", > popup_menu(-name=>'color', > -values=>['red','green','blue','chartreuse'])),
Thanks for the feedback. The Synopsis has been modernized now: All HTML generation has been removed from it: http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm#SYNOPSIS While CGI.pm does generate HTML, it is now considered a best practice to use a templating system instead, so we are de-emphasizing these features.