On Tue, Sep 25, 2001 at 01:09:48PM +0800, Stas Bekman wrote:
> Philippe M . Chiasson wrote:
> 
> > On Mon, Sep 24, 2001 at 09:29:10PM -0400, Geoffrey Young wrote:
> > 
> >>>currently we just grab the apr_table_get implementation for 
> >>>APR::Table::get(). The problem is that if there is more than one value 
> >>>added for the same key, get() will return one of these values. 
> >>>
> >>in 1.x this is only true in a scalar context (and is documented as such in
> >>the Apache::Table docs I believe)
> 
> 
> Yup, we have to implement this.
> 
> 
> >>>Undetermined which. Is this normal? e.g. I was trying to test 
> >>>$r->dir_config->get('key'), and there are a few values for 'key' (added 
> >>>via PerlAddVar), 
> >>>
> >>my @arr = $r->dir_config->get('key');
> 
> 
> so in the scalar context it brings the first key found and in the list 
> context the whole list. 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, the problem is knowing if there is only one entry or more than one.
The only way to know there is only one instance of the 'key' in the table
is to iterate over all the elements .. ;-(

I'd rather do it _exactly_ like in 1.x.

> 
> > my @arr = $r->dir_config->{'key'}
> > 
> > should also be avaliable
>  
> 
> right, that's the tie interface.
> 

yup.. anybody tried my latest APR::Table tied interface patch ?

> >>is the 1.x syntax.  I am actually very fond of this and wouldn't want to see
> >>it change in 2.0 without due discourse (were I to get a vote ;)
> >>
> > 
> > I agree. I just looked at the 1.x implementation and I'll try to squeeze it in
> > APR::Table.  Shouldn't be too complicated or too long at all.
> 
> 
> cool, thanks gozer! 
> > +my @arr = $table->get('key') vs my $key = $table->get('key');
> > +not implemented
> > +
> 
> 
> sure, let's first decide how this should work, if any change should 
> happen. I think I'll commit the complete API doc, so we can polish it 
> out and then build the code on top.
> 
> but, please, if you put something after the sig, at least mention that 
> you have something attached at the bottom. I understand that it makes it 
> easier to patch by feeding the whole email as-is to patch(1), but 
> sometimes I don't scroll after the sig... thanks.

But of course ;-)

> 
> _____________________________________________________________________
> 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/
> 
> 

-- 
+----------------------------------------------------+
| Philippe M. Chiasson  <[EMAIL PROTECTED]>             |
+----------------------------------------------------+
| F9BF E0C2 480E 7680 1AE5  3631 CB32 A107 88C3 A5A5 |
+----------------------------------------------------+
gethostent not implemented : Your C library apparently
doesn't implement gethostent(), probably because if it did,
it'd feel morally obligated to return every hostname on the
Internet. 
        -- perldiag(1)

perl -e '$$=\${gozer};{$_=unpack(P26,pack(L,$$));/^Just Another Perl 
Hacker!\n$/&&print||$$++&&redo}'

PGP signature

Reply via email to