Ok, I guess I'm not good enough XP-wise to edit my main post? Well, here's a new twist to the whole story. I logged in via ssh from my parent's home, ran the program, and it worked fine. I added the loop back in, changed back to the
$ldap->add() style of code, and it successfully added about 50 entries.
When I got back to my office this morning, it doesn't work. Is there something in my RH8 environment that might be knocking it out of shape? UTF-8 ?
here's what the debug=>8 out yielded...
Net::LDAP=HASH(0x8d9c378) sending:
Net::LDAP=HASH(0x8d9c378) received:
0000 12: SEQUENCE {
0002 1: INTEGER = 1
0005 7: [APPLICATION 1] {
0007 1: ENUM = 0
000A 0: STRING = ''
000C 0: STRING = ''
000E : }
000E : }
Net::LDAP=HASH(0x8d9c378) sending:
And it just hangs right there. My current code base (just the ldap part):
use Net::LDAP;
use Net::LDAP::Entry;
my $ldap = Net::LDAP->new('localhost',debug=>8);
my $bind_msg = $ldap->bind( dn => 'cn=Manager, dc=osprey,dc=net',
password => 'secret' );
if ( my $bind_code = $bind_msg->code ) {
die "Cannot bind:", $bind_msg->error,
" (Code: $bind_code)";
}
foreach my $username (sort keys %petra) {
my $dn = "uid=${username}_osprey_net, ou=users, ispmanDomain=osprey.n
+et, dc=osprey,dc=net";
my $ref = $petra{$username};
$result = $ldap->add( dn=> $dn,attr => [@$ref]
);
$result->code && warn "$dn" ."failed to add entry: ", $result->error ;
}