$ldap = Net::LDAP->new( 'ldap.umich.edu' ); # bind to a directory with dn and password $mesg = $ldap->bind( 'cn=root, o=University of Michigan, c=us', password => 'secret' ); die "Invalid credential" if $mesg->is_error;