Geoffrey Young wrote:

> 
>>-----Original Message-----
>>From: Stas Bekman [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, September 25, 2001 1:10 AM
>>To: Philippe M . Chiasson
>>Cc: Geoffrey Young; '[EMAIL PROTECTED] '
>>Subject: Re: :Table::get implementation?
>>
>>
> [snip]
> 
>>
>>so in the scalar context it brings the first key found and in 
>>the list 
>>context the whole list. 
>>
> 
> yes
> 
> 
>>Should we generate a warning if the above is 
>>called in the scalar context? Or is it OK, if you know that there is 
>>only one key?
>>
> 
> well, if you want to mimic 1.x 
> 
> my $key = $r->dir_config('key')
> 
> is valid (and more common), so I don't think it should produce a mandatory
> warning.


Of course, we want to preserve all the used 1.x functionality. We don't 
want people's code to break and make the transition easy.


> however, if Doug gets around to implementing the LogLevel optimizations
> someday maybe we could issue a warning at the debug level "Apache::Table key
> %s truncated - call in list context" or something

But then it'll throw a warning per request (if the code gets recompiled 
for example) and the person will have to fix the code anyway, unless 
PerlWarn is off, so I guess it doesn't matter.

There is another performance issue with setvars I'm thinking about. 
Currently when you perform $r->dir_config I have to merge the directory 
and server configs and give you the new table. This may be very 
expensive. Now we could avoid this by doing a deeper merge at the 
configuration stage, but since we allow $s->dir_config->set|add the $s'
vars can change and our merged version be wrong. So it sucks, 
performance wise of course, since we cannot pre-merge. I guess we should 
put a fat warning -- DO NOT Call $s->dir_config without arguments, 
unless you don't mind performance implications.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



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

Reply via email to