# perldoc > Net::LDAP::Message

---
type: CommandReference
command: Net::LDAP::Message
mode: perldoc
section: 
source: perldoc
---

## Quick Reference

- `code()` — Get result code value from server
- `error()` — Get error message from server
- `dn()` — Get DN from result message
- `done()` — Check if request completed
- `mesg_id()` — Get message ID of request
- `sync()` — Wait for server to complete request
- `control()` — Get list of controls from server
- `referrals()` — Get list of referrals

## Name

Net::LDAP::Message — Message response from LDAP server

## Synopsis

perl
use Net::LDAP;
## Methods

- `code()` — The code value in the result message from the server. Normally zero for success. Constants for result codes can be imported from `Net::LDAP` or `Net::LDAP::Constant`.
- `control( [ OID, ... ] )` — Return the list of controls returned from the server. If one or more OIDs are given, return only the controls of those OIDs.
- `dn()` — The DN in the result message from the server.
- `done()` — Returns true if the request has been completed.
- `error()` — Returns the error message from the server. If no error message included, returns the result of `ldap_error_desc` with the error code.
- `error_name()` — Returns the name of the error code. See `ldap_error_name`.
- `error_text()` — Returns a short text description of the error code. See `ldap_error_text`.
- `error_desc()` — Returns a long text description of the error code. See `ldap_error_desc`.
- `is_error()` — Returns true if the result code is considered an error for the operation.
- `mesg_id()` — The message id of the request message sent to the server.
- `referrals()` — Returns a list of referrals from the result message.
- `server_error()` — The error message returned by the server, or `undef` if none provided.
- `sync()` — Wait for the server to complete the request.

## See Also

[Net::LDAP](https://metacpan.org/pod/Net::LDAP), [Net::LDAP::Search](https://metacpan.org/pod/Net::LDAP::Search), [Net::LDAP::Constant](https://metacpan.org/pod/Net::LDAP::Constant), [Net::LDAP::Util](https://metacpan.org/pod/Net::LDAP::Util)