http://www.perlmonks.org?node_id=611854

artemave has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use $r->pnotes() to pass error message from a business handler to the special error one.
Here is the module where the error case is supposed to happen:
sub handler : method { my ($self, $r) = @_; ... $self->{r}->pnotes(error => 'Darn'); return Apache2::Const::SERVER_ERROR; } ... 1;
Now the special error handler:
sub handler { my $r = shift; $r->content_type('text/html'); $r->print($r->pnotes("error")); return Apache2::Const::OK; } 1;
And finally httpd.conf part to connect it all:
... ErrorDocument 500 /error ... PerlModule dir_browse::error <Location /error> SetHandler perl-script PerlResponseHandler dir_browse::error </Location>
The problem is that pnotes('error') does not keep its value when redirected to error handler (i tried to redirect explicitly using headers_out->set(Location => ...) and Apache2::Const::REDIRECT but the result was the same).
Now, I've read in pnotes doc that "The values get reset automatically at the end of each HTTP request". Does that mean, that in the above case the request is finished before getting to error handler? Or there is some other issue?

Thanks,
Artem.