Re: It did not QUITE work! Re: "strange error" is related to CGI.pm

[prev] [thread] [next] [Date index for 2005/05/13]

From: Randy Kobes
Subject: Re: It did not QUITE work! Re: "strange error" is related to CGI.pm
Date: 15:31 on 13 May 2005
On Fri, 13 May 2005, Igor Chudov wrote:

> I was too quick to say that it worked. It does not
> quite work with another PerlHandler of mine.
>
> I make a form, if I submit it with a GET method, it
> works. If I submit it with a POST handler, CGI fails
> to get parameters. I am most puzzled.

That is strange - there's a couple of tests in the
mp2 distribution (under t/modules/) that test POST
requests with CGI.pm. The handlers are simply:
======================================================
package TestModules::cgipost;
use strict;
use warnings FATAL => 'all';
use Apache2::compat ();
use CGI ();
use Apache2::Const -compile => 'OK';
sub handler {
    my $r = shift;
    $r->content_type('text/plain');
    my $cgi = CGI->new;
    print join ":", map { $cgi->param($_) } $cgi->param;
    Apache2::Const::OK;
}
1;
__END__
SetHandler perl-script
PerlOptions +GlobalRequest
=========================================================

and

========================================================
package TestModules::cgipost2;
# this handler doesn't use the :Apache layer, so CGI.pm needs to do
# $r->read(...)  instead of read(STDIN,...)
use strict;
use warnings FATAL => 'all';
use Apache2::compat ();
use CGI ();
use Apache2::Const -compile => 'OK';
sub handler {
    my $r = shift;
    $r->content_type('text/plain');
    my $cgi = CGI->new($r);
    $r->print(join ":", map { $cgi->param($_) } $cgi->param);
    Apache2::Const::OK;
}
1;
__END__
================================================================

Did these tests pass for you? Do these offer any clue
as to why yours doesn't work? If not, can you send a
minimal example of what doesn't work, along with the
relevant configuration directives?

        -- 
        best regards,
randy

(message missing)

"strange error" is related to CGI.pm
Igor Chudov 15:11 on 12 May 2005

Re: "strange error" is related to CGI.pm
Tom Schindl 08:12 on 13 May 2005

Re: "strange error" is related to CGI.pm
Igor Chudov 13:11 on 13 May 2005

Re: "strange error" is related to CGI.pm
Tom Schindl 13:39 on 13 May 2005

Re: "strange error" is related to CGI.pm
Willem Jan Withagen 13:46 on 13 May 2005

Re: "strange error" is related to CGI.pm
Igor Chudov 13:59 on 13 May 2005

Re: "strange error" is related to CGI.pm
Randy Kobes 14:04 on 13 May 2005

Re: It did not QUITE work! Re: "strange error" is related to CGI.pm
Randy Kobes 15:31 on 13 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52