From: Chris W. <ch...@cw...> - 2002-01-29 15:52:16
|
On Tue, 2002-01-29 at 10:19, Edd Dawson wrote: > I have a routine i use for changing users passwords, and i wanted to put in > some code so i can check the password was successfully updated, so i > checked the online docs, and came up with the following : > > my $result = $ldap->modify( $dn, replace => { 'userpassword' => > $new_password }); > > i was expecting $result to contain either 1 or 0 depending on whether the > operation was successful, but instead get > "Net::LDAP::Modify=HASH(0x88be34c)" now i know what i'm doing wrong is > probably so stupidly basic.. but i can;t figure out why it doesn;t work!!!! Just try: my $result = $ldap->modify( $dn, replace => { 'userpassword' => $new_password }); if ( $result->code ) { die "Error from modify: ", $result->error; } The POD for Net::LDAP has another example at the bottom of the SYNOPSIS. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |