To answer the question directly:

No, there are no real side-effects to this method. That way should work just fine. It might be fastest if you have this run before loading CGI.pm (via a BEGIN block). You could also check for

$ENV{'REQUEST_METHHOD'} ne "POST" ## or $ENV{'REQUEST_METHOD'} eq "GET" ## or even $ENV{'REQUEST_URI'} =~ /\?/
Finally, note that you original code, technically speaking, should test for the existence of QUERY_STRING, and not the truth of it, using defined or even exists. But since most cgi scripts require a pair, putting ?0000 will probably not do much for your scripts, so the truth test should suffice.

P.S. Sure it can be worked around, but it *will* prevent people from being able to bookmark a URL with parameters already set.


In reply to Re: Avoiding GET in CGIs by turnstep
in thread Avoiding GET in CGIs by Michalis

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.