most of the perl cgi modules (including the perl module named CGI) provide url parameter getter and setter functions that take care of encoding etc, so you don't need to re-invent the wheel--unless you really do need to. example
use CGI qw(:standard); if(param()) { if($a=param('a')) { /* code for url parameter a */ } } else { /* generate html form when not called with parameters */ /* the form submit url points to itself (the .pl) */ }
The first if checks that there are parameters present, which is very handy as you can attach code to the else for this if, to generate a form. In other words, the same perl script processes form/url parameters and data submitted OR generates a html form to fill in.
the hardest line to type correctly is: stty erase ^H

In reply to Re: encoding URL ampersands? by aquarium
in thread encoding URL ampersands? by Anonymous Monk

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.