Before posting this, I saw that you have replaced the entire contents of your post with an entirely new question. Please see How do I change/delete my post?, in particular "It is uncool to update a node in a way that renders replies confusing or meaningless". Because I already put some effort into my answer I am posting it anyways, and have considered your node for editing. (Update: It appears you edited your post multiple times and the version I saw was not the original. The same comments apply to those edits too.) Please post your new question in a new thread.

Trying to figure out a way to do an my $ldif = Net::LDAP::LDIF->new ... on the output of an exec qx ...
system qx[...];
Should I be using an System or Exec? I think I should be doing something like this, but use the ldap::ldif->new with EXEC?

Both system and qx// call external commands, so what this code is trying to do is run a command with qx[], get its entire output, and feed that as the arguments to a system command, which is almost certainly not what you want. I of course don't know this custom external dxsearch tool you are using and I am not an expert on Net::LDAP::LDIF, but its documentation does make clear that you can give Net::LDAP::LDIF->new a filehandle instead of a filename. Based on your description, in this case, that filehandle could come from, for example, a piped open, which I describe in my post here along with lots more on running external commands, which I also strongly recommend you check out.

I want to use perl to process the large ldif it creates and format it into a csv report.

Since the code you showed doesn't use it, I recommend Text::CSV (also install Text::CSV_XS for speed).


In reply to Re: open ldif by haukex
in thread Net::LDAP::LDIF->new Chokes on large LDIF because of comments every 5k lines by 3dbc

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.