a. How can I communicate a value from my cgi-script to a mod_perlYou don't detail what kind of handler you are talking about. But look at notes/pnotes (search perl.apache.org for examples), which are useful for passing data around.
handler. I know you can pass values from handlers to cgi-scripts using
$r->args and environment variables. But, what if I want to pass a value
from the cgi-script to a handler? It's obvious that the handler should
get called after the cgi-script gets executed.
Looks like you are a bit confused with 'handlers'. You may want to read the handler chapters at http://perl.apache.org/docs/2.0/user/index.htmlb.Also, I don't know of any handler that gets called after the content has been generated. PerlOutputFilterHandler is not what I want, because, there I have to read and manually 'print' all the output using $filter->print. If PerlOutputFilterHandler is the only option, then, can I modify the output headers in it?
You can insert several handlers (for each phase) using push_handlers or using the configuration file. Depending on the phase's behavior described here:
http://perl.apache.org/docs/2.0/user/handlers/intro.html#Single_Phase_s_Multiple_Handlers_Behavior
only the first handler returning OK (or error) or all of the handlers will be run.
And yes, you can modify output headers in PerlOutputFilterHandler, if the filter is a connection filter. Here is an example that does that for input headers, but will work the same for the output handlers:
http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_Input_Filters
Though it's probably not as fast as adjusting the headers via the api in the response handlers. However since you aren't telling what you are trying to do I can't give you a better advice.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com