I've looked at the mod_perl documentation on how to eliminate the problem of values being remembered when a named inner subroutine accesses a lexical symbol. I *thought* I was doing things correctly, but when I precompile (or even preload) CGI, I get the same types of problems, regardless.

mod_perl-startup.pm:
use lib 'c:/apps/apache/perl';

use CGI ();
CGI->compile(:standard);

1;


formtest.pl: use strict; use warnings; use My::Form;

dojob();


My/Form.pm: package My::Form; use strict; use CGI; use base 'Exporter'; our @EXPORT = 'dojob';

my $foo;
my $q;

sub do_work {
print "<html><body><form><input type=\"text\" name=\"foo\" value=\"$foo\"><br><input type=\"submit\"></form></body></html>";
}


sub dojob {
        my $q = new CGI;
        $foo = $q->param('foo');
        print "Content-type: text/html\n\n";
        do_work($foo);
}

1;


After the first time I submit the form, all subsequent requests preload the FIRST value in the form element.


When I REMOVE the use CGI; from the startup script, the problem goes away.

Am I using CGI improperly? I know that ultimately, it'd probably be better to use Apache::Request for the simple junk I'm using CGI for, but I'm on a Windows system, and I can't seem to find info on Apache::Request for mp2. (Is this what got broken out into Apache::RequestRec, Apache::RequestIO, and Apache::RequestUtil? I still can't find param() in any of them).

_________________________________________________________________
Scope out the new MSN Plus Internet Software — optimizes dial-up to the max! http://join.msn.com/?pgmarket=en-us&page=byoa/plus&ST=1



-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to