I've had several roles now, where people look at code like the following and go yeuch!!! But to my mind this is using the CGI.pm module pretty efficiently.

What's the consensus, here? Forgetting the whole separate design from code question, incidentally. That's a whole 'nother conversation! :)

Example here:

start_form({ -action=>"/cgi-bin/ff-webclient.pl", -name=>'searchForm', -id=>'searchForm' }), fieldset( legend('Query finished/currently running jobs'), div({-class=>"instructions"},""), table({-class=>"ats"}, Tr( td([ label({-class=>'small', -for=>'ff_job_id'} +,'FaultFinder ID'), textfield({-name=>'ff_job_id',-id=>'ff_job +_id'}) ]) ), ## end of Tr Tr( td([ label({-class=>'small', -for=>"searchby_us +er"},"Username"), textfield({-name=>'searchby_user',-id=>'se +archby_user'}) ]) ), Tr( td([ label({-class=>'small', -for=>"searchby_st +atus"},"Status"), textfield({-name=>'searchby_status',-id=>' +searchby_status'}) ]) ), Tr( td([ label({-class=>'small', -for=>"searchby_da +te_start"},"Time"), "begin".br.textfield({-name=>'searchby_dat +e_start',-id=>'searchby_date_start',-onchange=>"checkDate(this)"}). b +r . "end" . br . textfield({-name=>'searchby_date_end',-id=>'searchby +_date_end',-onchange=>"checkDate(this)"}) ]) ), Tr( td({-colspan=>'2'}, submit({-name=>"right_submit_button",-valu +e=>"Go",-onmousedown=>"checkForm('searchForm')"}), hidden({-name=>"submitted", -value=>"get_e +xisting_ff"}) ) ## end of td ) ## end of Tr ) ## end of table )## end of fieldset(); )## end of second holding ) ## end of second holding td ) ## end of holding Tr ); ## end of holding table


In reply to overuse of CGI module HTML methods? by weedom

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.