Net::LDAP::Util - Utility functions
use Net::LDAP::Util qw(ldap_error_text ldap_error_name ldap_error_desc ); $mesg = $ldap->search( .... ); die "Error ",ldap_error_name($mesg->code) if $mesg->code;
Net::LDAP::Util is a collection of utility functions for use with the Net::LDAP modules.
Returns the name corresponding with the error number passed in. If the error is not known the a string in the form "LDAP error code %d(0x%02X)" is returned.
"LDAP error code %d(0x%02X)"
Returns the text from the POD description for the given error. If the error code given is unknown then undef is returned.
undef
Returns a short text description of the error.
Returns the given DN in a canonical form. Returns undef if DN is not a valid Distinguished Name
It performs the following operations on the given DN
Lowercases values that are # followed by hex.
Uppercases type names.
Removes the leading OID. characters if the type is an OID instead of a name.
Escapes all RFC 2253 special characters, and any other character where the ASCII code is <32 or >= 127, with a backslash and a two digit hex code.
Converts all leading and trailing spaces in values to be \20.
If an RDN contains multiple parts, the parts are re-ordered so that the attribute names are in alphabetical order.
Note values that are hex encoded (ie start with a #) are not decoded. So SN=Barr is not treated the same as SN=#42617272
SN=Barr
SN=#42617272
Graham Barr <gbarr@pobox.com>
Copyright (c) 1999-2000 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
$Id: Util.pm,v 1.11 2001/04/12 16:40:40 gbarr Exp $
To install Net::LDAP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::LDAP
CPAN shell
perl -MCPAN -e shell install Net::LDAP
For more information on module installation, please visit the detailed CPAN module installation guide.