my $ldap = Net::LDAP->new( 'mydc.mydomain.com' ) or die "$@"; my $mesg = $ldap->bind( $account, password => $pwd ); $mesg = $ldap->search( # perform a search base => "ou=users, DC=mydomain, DC=com", filter => "(&(objectclass=user))" ); $mesg->code && die $mesg->error;