I've just recently come across what appears to me to be a bug with CGI::Simple. It comes up as missing form data. I've narrowed it down to the following small case. The first form submission works as expected, but any further submissions come up blank.

C:\Perl\site\lib> more MyPackage.pm package MyPackage; use strict; use CGI::Simple; require Exporter; use vars qw/@ISA @EXPORT $CGI/; @ISA = qw/Exporter/; @EXPORT = qw/init $CGI/; sub init { $CGI = CGI::Simple->new; } 1; C:\Apache2\www> more index.pl #!c:/perl/bin/perl -w use strict; use MyPackage; init(); print $CGI->header, '<html><body>'; print $CGI->param('text') if defined($CGI->param('text')); print <<'END_HTML'; <form action="index.pl" method="post" enctype="multipart/form-data"> <textarea name="text" rows="10" cols="70"></textarea> <input type='submit' /> </form> </body> </html> END_HTML

I also believe that this is an issue with CGI::Simple because if you replace the use of CGI::Simple with CGI, it works perfectly fine. My CGI.pm realizes it is running under mod_perl 2 ($CGI::MOD_PERL == 2), and I have commented out the necessary lines within CGI/Simple.pm for mod_perl compatibility. Any insights as to what CGI::Simple is doing wrong? Or is it just me?


In reply to CGI vs. CGI::Simple under mod_perl 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.