On Tue, 25 Jul 2000 17:52:50 +0800, "spencer" wrote:
> Hi,
> Thanks Chris, Reda for the suggestion. I just realised that the failure to
> display results might actually lie elsewhere. Reading a previous email,
> Cliff seemed to have the same problem too. The script runs without error,
> but without results too(sadly).
>
> Does the following code look 'buggy'?
>
> use Net::LDAP qw(:all);
> use Net::LDAP::Util qw(ldap_error_name ldap_error_text);
>
> $ldap=Net::LDAP->new('coriander.mail.abs.com.my') or die "$@";
> $mesg=$ldap->bind;
>
> $result=$ldap->search(
> base=>"o=abs,c=my",
> filter=>"sn=Jones",
> attrs=>['cn','sn']
> );
You ought to check the result code at this point, in case the server
returned an error.
$code = $result->code;
die "Error " . ldap_error_name($code) . "\n" if $code;
> By the way, I am using perl-ldap-0.19 with Convert ASN1 module and Active
> Perl v5.6.0. Any problem with this, possibly?
As Graham has noted, that's highly likely.
Cheers,
Chris
|