[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [mp2] The right way to use CGI parameters in a handler


Foo JH wrote:
You'd see that Apache2::Request exposes more stuff, which you can (lazily) use. Unless you are looking for some backward compatibility to tradditional CGI programming, why not embrace the entire modperl library?

That sounds good to me. I'm not looking for any particular backward compatibility, and speed is an issue.

As I said in my original post, I tried to use Apache2::Request, but after creating that object, I couldn't print anything anymore. Perhaps someone could give me a hint on how to implement it?

Here's the original code again.

# BEGIN CODE BLOCK
use Apache2::Const -compile => qw(OK);
use CGI;

sub handler
{
  my ($r) = @_;

  my $cgi = CGI->new($r);

  $r->content_type('text/html');

  if (defined $cgi->param('foo'))
  {
    print 'foo: ' . $cgi->param('foo') . "<br />\n";
  }

  return Apache2::Const::OK;
}
# END CODE BLOCK

Thank you very much.

Colin


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.