I've used the perl-ldap module with version 5.6.0 of Perl by Activestate on
Windows 2000 and am now trying it with Perl 5.6.1 under cygwin 1.1.8, but
with not much success. A simple script to search for an attribute on our
ldap server fails with an I/O error as follows:
I/O Error Resource temporarily unavailable
494f3a3a536f636b65743a3a494e45543d474
c4f422830786130323232386329 at ./find.pl line 14, <STDIN> line 1.
The script is as follows:
#!/usr/bin/perl
use Net::LDAP;
$ldap = Net::LDAP->new('ldap.mcc.ac.uk') or die "$@";
$ldap->bind or die "$@";
print("\nGetting username ...\n\n");
print("Username: ");chop ($user=<STDIN>);
print("Searching LDAP for username ...\n");
$mesg = $ldap->search(base=>"c=UK",filter=>"(uid=$user)");
$mesg->code && die $mesg->error;
$y = $mesg->count();
printf "$y entries found.\n";
foreach $entry ($mesg->all_entries) {
$dn=$entry->dn();
@mail=$entry->get('mail');
print("Distinguished name: $dn\nMail address: $mail[0]\n");
}
Anyone with any similar experiences of doing this? All help very much
appreciated.
Regards,
Tony.
--
Tony Arnold, Deputy Head of COS Division,
Manchester Computing, University of Manchester.
Tel: +44 161 275 6093, Fax: +44 870 136 1004, Mob: 0773 330 0039
E-mail: ton...@ma..., Home: http://www.man.ac.uk/Tony.Arnold
|