Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

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?

Replies are listed 'Best First'.
Re: CGI vs. CGI::Simple under mod_perl
by Anonymous Monk on Feb 25, 2004 at 01:50 UTC

    Let this be a lesson to me to check for newer releases of a module before bringing up issues of things not working correctly. This problem exists in the version 0.06 I had installed. An upgrade to 0.071 fixed everything just dandy. From the CHANGES file that comes with 0.07 (which is incidentally more or less the exact same as 0.071 - versioning problems):

    mod_perl compliant, patched by Mathew Albright