From: Graham B. <gb...@po...> - 2000-09-29 08:41:51
|
On Fri, Sep 29, 2000 at 12:03:22AM -0700, Robert Chien wrote: > Greetings, > > I'm putting together some code and learning perl-ldap for > the first time. I've run into a deadend and hope some of you > may provide some insight here. > > What I'm trying to do is quite simple, just adding an entry > to a LDAP server. > > $ldap->bind ( dn => "cn=something", > password => "somepasswd" ); > $result = Net::LDAP::Entry->new; > $result->add ( > dn => 'uid=$username,$base', > attr => [ 'objectclass' => [ 'top', 'person', > 'organizationalPerson', > 'inetOrgPerson', > 'inetUser' ], > 'mail' => '$mail', > 'userPassword' => '' > ] > ); > $result->update( $ldap ); Here is your problem. $mesg = $result->update( $ldap ); $mesg->code && warn "failed to add entry: ", $mesg->error; > $result->code && warn "failed to add entry: ", $result->error; > $ldap->unbind; > > This is pretty much out of the perldoc, but when I try to I hope not. Graham. |