I'm about to write my first set of CGI programs. I've got some very light form work to do, and some minimal HTML generation. This needs to be light from a memory and CPU standpoint, as it's going into a slow embedded system with a relatively small amount of RAM. I've already written the graphics-generating bits using GD and Chart::Plot (and they're not exactly blindingly fast), but now I need to add some moderately dynamic forms.

I note that Lincoln Stein has CGI version 3.03 or so on CPAN along with 2.753. Right now I have 2.752 loaded in one system. He says that version 3 is faster. Does this mean that it will require less memory as well on my system? I don't know whether I should try the version 3 in an attempt to ease the life of my little embedded system or should go with version 2, which is tried and true.

Note that this is not a "web site", nor is it particularly high traffic. I suspect that it'll get on the order of a few hits per day (most of the time it won't even be connected to anything with a display or browser). I just have to make sure that I don't start swapping too hard when it does get a hit (this is battery powered), and that responses come back reasonably fast.

I'm running a web server (httpi) that's based on Perl (demand loaded from xinetd). This is clever enough to just do a require on executable Perl programs, rather than doing the ugly CGI thing. Perl will be running all the time anyhow for data collection, so Perl itself will be at least partially shared.

Any feel for which CGI I should use? Or should I not bother? All I really need is query parsing and URL (un)escaping (I think); the HTML generation doesn't look terribly useful for me.

Note that security is not an issue here, as the device never has its web server connected to the Internet (satellite time is too expensive for that).


In reply to Should I use CGI3 for my first CGI program? by bikeNomad

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.