On 7/7/05 3:22, Brian Gaber <[EMAIL PROTECTED]> wrote:

> How would the following code be coverted to use Perl-LDAP?
>  
> my $ldapmodify  = "ldapmodify -h $ldap_master -x -c";
> my $context = "ou=test,ou=ncr,o=pwgsc";
> my $new_ou = "test";
>  
> open  (LDAP, "|".$ldapmodify);
> print  LDAP "dn: $context\n";
> print  LDAP "changetype: add\n";
> print  LDAP "objectclass: organizationalunit\n";
> print  LDAP "ou: $new_ou\n";
> close (LDAP);

Use Net::LDAP::LDIF to read in the entry, and then call
$entry->update($ldap) to send the modifications to the directory.

Cheers,

Chris


Reply via email to