Hmmm... So it looks to me like you've written your own web server. Thus, if you want CGI variables you'll need to get them yourself. That means you'll need to read the query sent by the browser and parse it. See the "Extracting a QUERY string" code in the snippets section; I've taken the liberty of patching in your code there. Also, you'll probably want to add the required HTTP headers to the output, so that an actual browser can look at it. (I'm assuming that browsers are looking at this, else why the query string? The query string is an artifact of the HTTP protocol.) I think also that there's a premade HTTP server module available on CPAN. You can probably adapt it for this use. Also, there's the URI module that comes with Perl; you can use that to parse the URL, and it will probably be more robust than my quick implementation. Good luck; we're all counting on you.

In reply to Re: How do I get QUERY_STRING when I use sockets? by stephen
in thread How do I get QUERY_STRING when I use sockets? by Delfer

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.