Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: working with DBI and Net::Ldap::Ldif

by g0n (Priest)
on Feb 17, 2006 at 08:40 UTC ( [id://530886]=note: print w/replies, xml ) Need Help??


in reply to working with DBI and Net::Ldap::Ldif

line 96 is

$ldif->write($pwarray->[$i][0]);//string
which is the first line attempting to write to the LDIF file. You appear to be trying to write a string attribute value 'username'. Net::LDAP::LDIF expects the parameter to 'write' to be a valid Net::LDAP::Entry object. You need to construct a Net::LDAP::Entry object for every LDAP object you want to create in your LDIF file, and pass that to 'write'.

Example:

use strict; use warnings; use Net::LDAP::LDIF; use Net::LDAP; my @entryvalues = qw( testuser testcn testsn ); my $entry = Net::LDAP::Entry->new(); $entry->dn("cn=".$entryvalues[1].",ou=test,dc=test,dc=com"); $entry->add( "uid" => $entryvalues[0], "cn" => $entryvalues[1], "sn" => $entry[2], "objectclass"=> "inetorgperson" ); my $ldif = Net::LDAP::LDIF->new("file.ldif","w"); $ldif->write($entry);

--------------------------------------------------------------

"If there is such a phenomenon as absolute evil, it consists in treating another human being as a thing."
John Brunner, "The Shockwave Rider".

Can you spare 2 minutes to help with my research? If so, please click here

Replies are listed 'Best First'.
Re^2: working with DBI and Net::Ldap::Ldif
by philosophia (Sexton) on Feb 17, 2006 at 15:44 UTC
    thanks, that helped a lot.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-23 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found