I had been having trouble gettng CGI.pm to recognize POSTed params under mod_perl. After much commenting of code, it appears the culprit is XML::Simple.

If you run the following (stripped down to show problem) script under normal cgi, and click the button, things work fine and you can see the form parameters (I Dump $q for convenience; in practice, I use $q->param()).

But if you run under mod_perl you don't see any POSTed params, although any in the query string do show.

Commenting out the "use XML::Simple", and all is well under mod_perl. Is there something else I'm missing or is XML::Simple doing something unexpected? Note that you don't even have to call any XML::Simple methods, just "use" it, to make this problem show up.

#! /perl/bin/perl -w use strict; use CGI; use Data::Dumper; use XML::Simple; print "Content-type: text/html\n\n"; print "<BODY><HTML>"; print '<h1>testing</h1>'; my $q = CGI::new; print "<pre>" . Dumper($q) . '</pre>'; print qq[ <form method=post > fld1 <input name=fld1 > <br>fld2 <input name=fld2> <br><input type=submit name=btn_submit value="submit"> </form> ]; print '</body></html>';

In reply to XML::Simple.pm breaks CGI.pm under mod_perl? by voyager

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.