NAME

Tie::LDAP - Tie LDAP database to Perl hash.

SYNOPSIS

use Tie::LDAP;

tie %LDAP, 'Tie::LDAP', {
    host => $host, # LDAP hostname
    user => $user, # DN used to access LDAP database
    pass => $pass, # Password used with DN for access
    base => $base, # Base DN used for each/keys/values operation
};

DESCRIPTION

This library allows you to tie LDAP database to simple hash. Once tied, all hash operation will cause corresponding LDAP operation, hopefully as expected.

Fetching data from tied hash will return hash reference to named (by full DN) LDAP entry, which hold the attributes in lowercase as a key, and the references to ARRAY holding the real values as a value.

Storing data is as easy as fetching: just push hash reference - with the same structure as fetched hash - back in.

Also, fetching/storing data into fetched hash reference will work as expected - it will manipulate corresponding field in fetched LDAP entry.

BUGS

Doing each/keys/values operation to tied hash works, but could be _very_ slow, depending on the size of the database.

Also, though this is not a bug, substituting empty array to tied hash will cause whole database to be cleared out. I might disable this feature since almost nobody would want to see this happen anyway.

COPYRIGHT

Copyright 1998-1999, T. Yamada <tai@imasy.or.jp>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Net::LDAP