> -----Original Message-----
> From: Stas Bekman [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 04, 2001 9:27 AM
> To: Geoffrey Young
> Cc: modperl-2.0 dev-list
> Subject: Re: why header_(in|out) are deprecated in 2.x?
> 
> 
> 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'

actually, my suggestion (if it didn't come across well) was to scrap 

  $r->header_out(foo => 'bar')

entirely, and advocate

$r->headers_out->set(foo => 'bar')

over the tied hash arrangement as the official API.

the shortcut

$r->headers_out(foo => 'bar')

is nice to have, but using set() on the object is more descriptive of what
is really taking place, and may help clarify things for the end-user.

--Geoff

> 
> 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.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to