Here are my scripts... I am having trouble with perldap. I've tried the
CVS version and everything. I watch the server's logs (iplanet ds5.1)
and the connection and search are good (no errors, returns 1 entry from
search). But I can't seem to handle the results, print them, etc.
What is wrong with my script?

#!/tools/perl/5_004_04/bin/perl -w
# testing hashes from return of ldapsearch
# testing changing of ldapinfo
use diagnostics;
use Mozilla::LDAP::API;
use Mozilla::LDAP::Conn;
use Mozilla::LDAP::Utils;
use Mozilla::LDAP::LDIF;
my $base="ou=dev,o=iss"; my $host="iss-dir-p02.jsc.nasa.gov";
my $port="400"; my $bind="uid=ctdummy,ou=people,ou=dev,o=iss";
my $pwd="tespwd!"; my $cert="";
my $srchfor="uid=". $ENV{USER} ;#"uidnumber=$<";
print "Searching for: $srchfor\n";
  $conn=new Mozilla::LDAP::Conn ($host, $port);
 die "No connection!\n" unless $conn;
$entry = $conn->search($base, "sub", $srchfor);
print "Entry search is: $entry\n";
$entry->printLDIF();
 while ($entry)
  {   #$entry->printLDIF();
 print "O-ho! we do match entry.\n";
 if ($_){ print "_ $_ .\n"; }
 $entry = $conn->nextEntry();
 if ($entry) { print "Next entry: $entry .\n"; }
  }



Reply via email to