Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re^3: Parsing of LDAP entry (get_value( $var, asref => 1 );

by Anonymous Monk
on Jul 31, 2013 at 07:38 UTC ( #1047192=note: print w/replies, xml ) Need Help??

in reply to Re^2: Parsing of LDAP entry (get_value( $var, asref => 1 );
in thread Parsing of LDAP entry

I can't imagine that its necessary that you parse this yourself, see, Net::LDAP::Control::EntryChange, and employ more dumpering :)

  • Comment on Re^3: Parsing of LDAP entry (get_value( $var, asref => 1 );

Replies are listed 'Best First'.
Re^4: Parsing of LDAP entry (get_value( $var, asref => 1 );
by mariusz (Initiate) on Aug 01, 2013 at 10:21 UTC

    Uff solved:

    (...) my $chang = &_changes($entry->get_value("changes")); my %changes = %$chang; sub _changes { my $changesSTR = shift; my (%changes, @tmp); $changesSTR =~ s/\n/ /g; foreach my $element(split(/\s-\s/,$changesSTR)){ if ($element =~ m/(replace|add|delete):\s+([^\s]*)\s*\w+\s +*:\s*(.*)$/) { my ($var1,$var2,$var3) = ($1, $2 ,$3); push @tmp,$var3 ; $changes{$var1}{$var2} .= "@tmp" ; @tmp=undef; } elsif ($element =~ m/(replace|add|delete):\s+([^\s]*)$/ +){ $changes{$1}{$2} .= "undef" ; } } return \%changes; }

    Maybe solution is not pretty, but works ;)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047192]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2016-10-26 10:29 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (340 votes). Check out past polls.