Geoffrey Young wrote:
>
>>-----Original Message-----
>>From: Stas Bekman [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, October 04, 2001 5:18 AM
>>To: modperl-2.0 dev-list
>>Subject: why header_(in|out) are deprecated in 2.x?
>>
>>
>>I know that gozer has implemented the deprecated
>>header_(in|out), but why
>>do we deprecate the two? reducing the number of ways to do
>>the same thing?
>>
>>In any case the documented new syntax for:
>> $r->header_out(foo => 'bar'),
>>now should be:
>> $r->headers_out->{foo} = 'bar';
>>right?
>>
>
> personally, I think the Apache::Table interface is one of the coolest things
> about mod_perl, which is why I latch on to these :)
Geoff, your comments are all valid, but I believe in a daily use for an
average programmer, it's much easier to grasp:
$r->header_out(foo => 'bar'),
than:
$r->headers_out->{foo} = 'bar';
this one is better:
my $headers = $r->headers_out;
$headers->{foo} = 'bar'
but requires 2 lines of code.
$r->headers_out->set(foo => 'bar') is fine though. I'd use this one in
the common user docs's examples (not API docs) rather than the tied
interface, when you want to get/set a single key and don't need to
re-use the object.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]