This sample shows how to use the perl-ldap module to connect/bind to eDirectory.
#!perl
use Net::LDAP;
use Net::LDAP::LDIF;
use File::Path qw(rmtree);
use File::Basename qw(basename);
print "Content-type: text/html\n\n";
$HOST = '137.65.138.159';
$PORT = 389;
$PASSWD = 'novell';
$BASEDN = "o=novell";
$ADMIN= "cn=admin,o=novell";
#connect to the server
until($ldap = Net::LDAP->new($HOST, port => $PORT)) {
die "Can not connect to ldap://$HOST:$PORT/" if ++$count > 10;
sleep 1;
}
© 2008 Novell, Inc. All Rights Reserved.