[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: OpenLDAP and Net::LDAP (perl)



There is a mailing list for Net::LDAP .
the address is
perl-ldap@mail.med.cornell.edu

People out there might be in a better position to help on this.
I have used Net::LDAP before ( but not extensively)  and it worked fine
for me.

I am not sure about your problem but it seems you might be having problem
in accessing the data in a correct way.
I am including a segment of mail from Eric. It includes a code that helped
me to extract the data. Thanks Eric :)
-----------------------------------------------------
the code should have looked like:
>
>  $results = $ldapserver->search(
>                                 base => $gemdn,
>                                 filter => "cn=$cn$i"
>                                );
>  @all_entr = $results->entries;
>  $an_entry = $all_entr[0];
>  @list = $an_entry->attributes;
>  for (@list) {
     @all_values = $an_entry->get($_);
     $value = $all_values[0]; #since I know I only have one value
     print "$_, = $value\n";
>  }

Eric S Johansson        esj@inguide.com   esj@harvee.billerica.ma.us

--------------------------------------------------------------------


Hope this helps

-Himanshu



On Fri, 9 Apr 1999, Daniel Austin wrote:

> Hi,
>
> Is anyone out there using Perl and Net::LDAP to talk to their OpenLDAP server?
>
> I have OpenLDAP (stable tag via CVS) with a few objects in the slapd database.
> I can query just fine using ldapsearch:
>
> 	ldapsearch -b "o=AustLII, c=AU" -p 2710 'objectclass=*'
>
> But when using Net::LDAP in Perl I get nothing:
>
> 	use Net::LDAP;
> 	my $ldap = new Net::LDAP ('localhost', port => 2710 ) || die "ldap: $!";
> 	$ldap->bind() || die "bind: $!";
> 	my $res $ldap->search( base => 'o=AustLII, c=AU",
> 		filter=>'objectclass=*' );
l>
> The "code" that is returned ($res->code) is 32 -- but no error message appears
> to be associated with it.
>
> Is anyone using Perl to talk to OpenLDAP -- which Perl module? I know there
> are a few. Any ideas on what might be wrong with my use of Net::LDAP? When I
> use Net::LDAP's examples, everything works fine.
>
> Dan
> --
> Daniel Austin (dan@austlii.edu.au)
> Primary Materials and Programming Support, AustLII
>