From: Graham B. <gb...@po...> - 2000-09-29 13:43:00
|
In the latest release there is an $entry->exists( $attr ) method Graham. On Fri, Sep 29, 2000 at 07:53:30AM -0400, Eric Boehm wrote: > I recently upgraded from perl-ldap-0.13 to perl-ldap-0.22 and some code I had > written broke. > > I dropped back to 0.13 and downloaded every version since then. The problem > starts in perl-ldap-0.16 where attrs is a cache. > > I have code that looks like this > > $mail_address = ${ $entry->get( $external_addr ) }[0] > if ( $entry->{attrs}{$external_addr} ); > > unless ( $mail_address ) { > $mail_address = ${ $entry->get( $internal_addr ) }[0] > if ( $entry->{attrs}{$internal_addr} ); > } > > I did this to avoid error messages about uninitialized values. However, I see > that in 0.16 the attrs hash doesn't get built until $entry->get is called. > > So ... I have a catch-22 -- I can't check to see if an attribute exists > without getting a possibly non-existent attribute. > > Is there a better way to code for this situation? I tried a couple of ways to > call _build_attrs directly but I couldn't seem to get the syntax right > ( $entry->_build_attrs and $entry->Net::LDAP::Entry::_build_attrs). > > Please cc to my email address as well as the list. I am trying to subscribe to > the list but I don't know how long it will take. > > Thanks in advance, > -- > Eric M. Boehm bo...@no... |