William Skinner wrote:
>
> for (@entries){
> $res = $c->add($_);
> warn "Error in add for ". $_->dn().": error code ".$res->code."\n"
> if $res->code();
> }
> print "The error message is: ".$res->error."\n";
> $c->unbind();
>
> The error is;
>
> Can't call method "error" on an undefined value at
> /root/ldap/bin/addldif2ldap.pl line 25. ****line 25 is the print "The error
> message is:" from above script***
>
I believe @entries is empty at the time.
So the for-block is never entered,
so never $res = $c->add($_); is executed,
so $res is undefined,
and of course undefined has no methed error.
Greetings,
Andrea
PS: Use always use strict; for scripts larger than 10 lines !!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]