perl-docs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject Re: Quick Documentation Fix
Date Fri, 07 Apr 2006 12:54:43 GMT

Miles Crawford wrote:
> On:
> and
> it is suggested that the proper syntax for adding a header is:
> $r->headers_out->add('Set-Cookie' => $cookie);
> This howerver does not work. 

of course it does.  you can see from yourself in the mod_perl test suite:

t/response/TestAPI/ [21]:
$r->err_headers_out->add('X-err_headers_out' => "err_headers_out");

using the set() or add() interface is the preferred method, over the tied
interface shown below.

> The example at:
> has it right, with:
> $r->headers_out->{'Pragma'} = "no-cache";

this documentation is for the compat layer.  I can't recall offhand whether
this syntax works without Apache2::compat or not.

but regardless, so you know, the first example adds to any existing
Set-Cookie outgoing headers, and only in the headers_out table, which will
not persist across REDIRECT responses (use err_headers_out for that).  the
second example overwrites any existing Pragma headers in headers_out table.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message