On Thu, Aug 5, 2010 at 03:52, sync <jian...@gmail.com> wrote: > Hi, guys: > > i have a perl script that supposed to add users to ldap . when i run the > script it get: > > Can't call method "get_value" on an undefined value at ./add_user.pl snip > my @entries = $mesg->sorted('uidNumber'); > my $entry = pop @entries; > > my $newuid = $entry->get_value( 'uidNumber'); snip
My bet is that if you check @entries you will find it is empty. Try something like my @entries = $mesg->sorted('uidNumber'); die "there are no entries" unless @entries; my entry = pop @entries; -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/