Jamie Krasnoo wrote:
[...]
$r->headers_out(Location => '/some/place.html');
return Apache::DECLINED;

why DECLINED? just return Apache::OK.

My mistake, its been a while and I'm just getting back into it. So its like I'm learning everything all over again. You can use OK? The example in the Eagle book uses REDIRECT within a handler for redirection. So I'm assuming it goes the same for MP2.

You are right, one returns OK if using parsed headers, as in this example:


sub handler {
    my $r = shift;

my $location = $r->args;

print "Location: $location\n\n";

    Apache::OK;
}

I got the redirection to work. However I don't think its working as it
should. Nowhere in the docs does it say that you have to load APR::Table
with Apache::RequestRec and Apache::RequestIO to have $r->headers_out()
to work. Without APR::Table loaded I get the error:

[Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate
object method "STORE" via package "APR::Table" at
/www/web/perl/MyApache/Redirect.pm line 17.

$r->headers_out returns a tied hash reference, so ones needs to load APR::Table in order to work with this reference. Doc patches are very welcome.


__________________________________________________________________
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