[Please mention mp2 in the subject/body of the message so we don't have to guess what version you are talking about]

a. How can I communicate a value from my cgi-script to a mod_perl
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.
You 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.

b.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?
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.html

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



Reply via email to