Gents,

I have one problem with Perl, so I would appreciate if you could help to find the best solution for that.

In my company we use SunOne LDAP. I want to connect to cn=changelog and read all entries in this node.

Structure of one entry looks like that:

dn: changeNumber=123,cn=changelog objectClass: top objectClass: changelogentry ...something not important.... changes: BASE64_TEXT

When I try to read ($entry->get_value("changes")) and decode changes, then I received something like this:

replace: A A: new_value - add: NEW_VAR NEW_VAR: ABC - delete: ABC - replace: history history: 1 history: 2 history: 3 -

In my case on the output I want to get (single line):

ADD: NEW_VAR=ABC|REPLACE: A=NEW_VALUE, HISTORY=1,2,3|DELETE: ABC.

Is there any simple way to "PARSE" changes value? Unfortunately, type of this value is string..


In reply to Parsing of LDAP entry by mariusz

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.