Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Find it at: http://search.cpan.org/search?dist=perl-ldap

Description
Net::LDAP implements an OO interface to LDAP directories, allowing you to search, display and modify the information contained therein.

Who should use it?
Anyone who has to write perl that talks to an LDAP directory.

Good features: Has good default behaviour so you do not have to pass lots of specifics if you don't need to.
Will work asynchronously so that you can be doing work with the first results returned whilst the search is still being carried out

What are the drawbacks or problems?
There is no non-OO interface.
Must install Convert::ASN1.

Example code:
Code to dump the entire database (from the perspective of an anonomous bind.)
#!/usr/bin/perl -w use Net::LDAP; $ldap = Net::LDAP->new('127.0.0.1') or die "$@"; $ldap->bind ; # an anonymous bind $mesg = $ldap->search ( # perform a search base => "c=US", filter => "(objectclass=*)" ); $mesg->code && die $mesg->error; foreach $entry ($mesg->all_entries) { $entry->dump; } $ldap->unbind; # take down session

20050126 Janitored by Corion: s!Covert!Convert!, closed code tag


In reply to NET::LDAP by bobtfish

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-19 23:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found