From: Javier R. <te...@rd...> - 2000-10-12 20:17:05
|
----- Original Message ----- From: <per...@li...> To: <per...@li...> Sent: Thursday, October 12, 2000 9:15 PM Subject: perl-ldap-dev digest, Vol 1 #139 - 1 msg > Send perl-ldap-dev mailing list submissions to > per...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.sourceforge.net/mailman/listinfo/perl-ldap-dev > or, via email, send a message with subject or body 'help' to > per...@li... > > You can reach the person managing the list at > per...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of perl-ldap-dev digest..." > > > Today's Topics: > > 1. Net::LDAP::LDIF::write_cmd with unchanged entry (Chris Brierley) > > --__--__-- > > Message: 1 > From: Chris Brierley <bri...@po...> > To: per...@li... > Subject: Net::LDAP::LDIF::write_cmd with unchanged entry > Date: 11 Oct 2000 16:04:05 -0400 > > I've noticed some behavior that I didn't expect with > Net::LDAP::LDIF::write_cmd. I don't know if this is a bug or > planned, but it caught me off guard. > > It seems that write_cmd causes a fatal error if called on an entry > that has not been changed. E.g. I'm iterating over a bunch of > entries, making changes if they are necessary, and writing out an > LDIF file which represents the change with: > > Net::LDAP::LDIF->new(\*LDIF_FINAL)->write_cmd($entry); > > If $entry has *not* been changed, my program dies with: > > ,---- > | Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/site_perl/5.005/Net/LDAP/Entry.pm line 278. > `---- > > That's the changes subroutine: > > ,---- > | sub changes { > | @{shift->{'changes'}} > | } > `---- > > An entry which is returned from a search and not changed does not > have a changes key, and thus the above routine dies. > > I can easily work around this by keeping track of whether I modify > the entry or not and only call write_cmd if it's been modified > .. but this behavior was very unexpected to me. Should'nt > write_cmd simply not write anything out if there is nothing to > change? > > Thanks. > > > > --__--__-- > > _______________________________________________ > perl-ldap-dev mailing list > per...@li... > http://lists.sourceforge.net/mailman/listinfo/perl-ldap-dev > > > End of perl-ldap-dev Digest > |