If you're using CGI.pm, you just "print" the header, followed by the HTML as it should be passed along to the browser. So if you can construct the table with plain-old-HTML, just do the same using print statements from Perl (don't worry about the CGI.pm helper tags if they just complicate things).

But as for how to program the entire interactive process, that's not only a little more than I'd be prepared to write in a reply here, it's been covered at length. Look at Ovid's CGI course, for example, or CGI Programming with Perl (O'Reilly -- The mouse book, 2nd edition). Both are really old (Ovid's course is on the way-back machine), but that's because CGI itself is really old.

If you're just starting out this whole process, I would personally recommend not going the bare-CGI route, and instead, use a framework like Mojolicious. Create a Lite App. It's a lot simpler, in my opinion, than dealing with plain old CGI, and it can still work in a CGI environment. Eventually you'll find that you still need to learn the CGI fundamentals, but Mojolicious and other modern frameworks make it so much nicer. In the case of a "lite app", you simply set up hybrid controller/routes that populate templates. It's pretty slick.


Dave


In reply to Re: CGI Table with checkboxes by davido
in thread CGI Table with checkboxes by halecommarachel

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.