Example: Authentication
#setup global parameters, using Getopt
$srch = “(uid=“ . $ENV{USER} . “);
$c = new Mozilla::LDAP::Conn($host,$port);
$entry = $c->search($base, “SUB”, $srch);
if ($entry && !$c->nextEntry() {
die “Bummer dude!” unless
$conn->simpleAuth($dn,$pwd);
# We had a good authentication, go on!