M J wrote:
I don't think that CGI.pm is a solution when you need performance.
There is an article
(http://perl.apache.org/docs/1.0/guide/performance.html#Apache__args_vs__Apache__Request__param_vs__CGI__param)
which describes this.
You are worrying far too much about this. I use CGI.pm in many sites
without any problems. It calls the Apache API directly and then does
the parsing in Perl. The libapreq library is faster, but you will only
save a few milliseconds per request. There are probably hundreds of
other things you could tune in your application that would make a much
bigger difference.
If your application is slow, use a profiler and find out what's slowing
it down, then fix that. I'm almost certain you will not notice any
difference by switching to libapreq.
I wrote this
because I don’t understand why you can NOT do this simple and so
important task (reading params) using only mp2 core API.
Because parsing CGI-style parameters is not part of the functionality of
a web server, and Apache HTTPD is a web server, and mod_perl is an
interface to it. You will notice that mod_cgi doesn't do this for you
either. The original mod_perl had a feature for parsing parameters, but
it had problems with some kinds of input and Doug eventually regretted
adding it. The libapreq library is now used by multiple Apache projects
and handles a lot of things that the old mod_perl 1 API never did right.
but probably that’s why so many
programmers work with php (for simple tasks you have to install new
modules).
The CGI module is all you need to read parameters and it has come with
Perl for years. If you'd like to help improve the mod_perl
documentation so that people don't get scared away from it, feel free.
- Perrin