From: Olaf F. <Ola...@bl...> - 2001-04-04 15:47:19
|
Hi, on W2K I'm using the perk which is contained in the cygwin installation. I've successfully installed Net::LDAP from CPAN. When I try it with the following script -------------------------------------------------------------------------= ------------- #!/usr/bin/perl -w use strict; use constant DEBUG =3D> 0; use constant ONLY_PERL =3D> 0; use Net::LDAP; my $ldap_server =3D "ldap.fra.sesa.de"; my $search_base =3D "dc=3Dsesa,dc=3Dde"; my @fields =3D qw(cn mail sn fn uid); # list of the fields that will be used for composing the answer my $expected_answers =3D "cn fn sn mail business_group telephonenumber"; #8<------8<------8<------8<------8<--------->8------>8------>8------>8---= --->8 my $ldap_server_nick; my @results; print "DEBUG: ldap_server=3D$ldap_server search_base=3D$search_base\n" if (DEBUG); $/ =3D ''; # Paragraph mode for input. foreach my $askfor ( @ARGV ) { # enable this if you want to include wildcard in your search with some # huge # ldap databases you might want to avoid it # my $query =3D join '', map { "($_=3D$askfor*)" } @fields; my $query =3D join '', map { "($_=3D$askfor)" } @fields; $query =3D "(|" . $query . ")"; my $ldap =3D Net::LDAP->new($ldap_server, DN =3D> "", Password =3D> "= ", Port =3D> 389, Debug =3D> 3,) or die $@; $ldap->bind; my $mesg =3D $ldap->search( base =3D> $search_base, filter =3D> $quer= y ) or die $@ ; $mesg->code && die $mesg->error; my @entries =3D $mesg->entries; map { $_->dump } $mesg->all_entries if (DEBUG); my $entry; foreach $entry (@entries) { print "DEBUG processing $entry->dn\n" if (DEBUG); # only keep the first email address, telephonenumber and businessgroup my $email =3D $entry->get_value('mail'); my $phone =3D $entry->get_value('telephonenumber'); my $sector =3D $entry->get_value('business_group'); my $cn =3D $entry->get_value('cn'); my @name =3D ($entry->get_value('fn'), $entry->get_value('sn')); push @results, "<$email>\t@name\t\n"; # this one works mostly for everyody # push @results, "<$email>\t@name\n"; } $ldap->unbind; } print "LDAP query: found ", scalar(@results), "\n", @results; exit 1 if ! @results; -------------------------------------------------------------------------= ------- On linux it works well but on W2K it gives me the error IO::Socket::INET: Timeout at ./test line 35. It's not a problem of the value of the timeout I've set it much higher with the same result. Greetings Olaf -- Olaf F=F6llinger S.E.S.A. AG GS Berlin mail: Ola...@se... fon: +49-30-390722291 |