=20
-----Original Message-----
From: Jeremiah Foster=20
Sent: den 27 november 2007 09:20
To: 'Dennis Putnam'
Subject: RE: ldapsearch equivalent with Net::LDAP
=20
=20
> I am trying to do the equivalent of this search:
>=20
> ldapsearch -x -LLL -b "dc=3Dldaphost,dc=3Dmydomain,dc=3Dcom" uid
Caveat Emptor: I am no LDAP genius.
=20
> Here is one of the many variations I tried:
>=20
> use strict;
> use Net::LDAP;
>=20
> my $ldap=3DNet::LDAP->new("ldaphost.mydomain.com") or die "$@[EMAIL PROTECTED]
";
Try replacing $@[EMAIL PROTECTED]
with $!. You are using $@[EMAIL PROTECTED]
which is the eval error
message, but I don't see where you are using eval. $! will tell you what
went wrong since it is the sys/libcall error message.=20
> my $mesg=3D$ldap->bind();
>=20
> if ($#ARGV<0) {
> $mesg=3D$ldap->search(
> base=3D>"dc=3Dldaphost,dc=3Dmydomain,dc=3Dcom",
> attrs=3D>["uid"]
> );
> print $mesg->entries(),"\n";
> }
> else {
> }
> $ldap->unbind();
>=20
>=20
> I am just starting so my code is incomplete but it should be enough to
> get something. However, I get nothing, not even an error. Can someone=20
> see what I am doing wrong? TIA.
See what your code spits out now and diagnose from there. Hopefully that
is a start.
Jeremiah


|