NAME

Net::LDAP::Util - Utility functions


SYNOPSIS

  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;


DESCRIPTION

Net::LDAP::Util is a collection of utility functions for use with the Net::LDAP modules.


FUNCTIONS

ldap_error_name ( NUM )

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_text ( NUM )

Returns the text from the POD description for the given error. If the error code given is unknown then undef is returned.

ldap_error_desc ( NUM )

Returns a short text description of the error.

canonical_dn ( DN )

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

Note values that are hex encoded (ie start with a #) are not decoded. So SN=Barr is not treated the same as SN=#42617272


AUTHOR

Graham Barr <gbarr@pobox.com>


COPYRIGHT

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 $