Well... you have a bunch of Net::LDAP::Entry objects and you write them down in LDIF format using write_entry...

What do you want to be explained?

Anyway, a snippet of code I wrote in 5 minutes

#!/usr/bin/perl + use strict ; use warnings ; + use Net::LDAP ; use Net::LDAP::LDIF ; + my $ldap = Net::LDAP->new('10.39.0.208',port => 3268) ; die unless defined $ldap ; + $ldap->bind('a_dn_of_mine', password => 'a_password_of_mine') or die ; + my $res = $ldap->search(base => 'dc=tiscali,dc=com', filter => '(givenName=Marco)') ; + die $res->code if $res->is_error ; + my $ldif = Net::LDAP::LDIF->new('myself.ldif','w') ; die unless defined $ldif ; + $ldif->write_entry($res->entries) ; + $ldif->done ; $ldap->unbind ;

I hope it helps

Ciao!
--bronto


The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz

In reply to Re: Net::LDAP::LDIF by bronto
in thread Net::LDAP::LDIF by nqklooless

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.