mod_perl newbie gotcha

[email protected] ("[email protected]")
Newsgroups perl.beginners.cgi
Organization http://groups.google.com
Message-ID <[email protected]>
Looking for help from anyone with mod_perl experience - I have been
caught by a classic newbie gotcha... I think.

Running Activestate Perl v5.8.8 for MSWin32, Apache 2.0 for Win32

I believe I have correctly installed mod_perl as $ENV{'MOD_PERL'}
correctly reports the version "mod_perl/2.0.3"

Two simple example CGI scripts -

*The first sends the contents and name of textfield to the second.
*The second script should then print the value of the textfield to
the screen.

The problem is that after the first successful send/receive, all
subsequent executions contain the same initial data: the parameters
never get reset with 'newer' data.

I understand that mod_perl is pretty fussy about closing down
assignments and undefining variables, working with 'strict' and
avoiding Globals.

I would appreciate anyone pointing out the (hopefully) obvious
mistake in my code below - or any guidance at all.

Cheers
NJH

pass_from.cgi
------
#!c:/perl/bin/perl.exe

use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use DBI;

my $q = new CGI;
print $q->header, $q->start_html(-title=>'Pass From'),
"mod_perl - $ENV{'MOD_PERL'}<p>",
$q->start_multipart_form(-action=>"pass_to.cgi"),
$q->textfield(-name=>'id', -size=>10),
$q->submit(),
$q->end_form();

$q->delete('id');

print $q->end_html;
exit();


pass_to.cgi
------
#!c:/perl/bin/perl.exe

use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use DBI;

my $q = new CGI;
print $q->header, $q->start_html(-title=>'Pass To'),
"mod_perl - $ENV{'MOD_PERL'}<p>";

foreach my $val($q->param()){print "$val: ",$q->param($val);}

print "<p><a href='pass_from.cgi'>Return</a>";

$q->delete('id');

print $q->end_html;
exit();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.