From: Thomas F. <in...@th...> - 2000-06-20 16:28:25
|
Hi, how to time out queries that have no result? use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text) ; $ldap_host = 'xx.xx.xx.xx'; $ldap = Net::LDAP->new($ldap_host) or die $@; # superbroker account $ldap->bind(dn => 'cn=Administrator, o=SomeCompany,ou=Members', password => 'topsecret', ) or die $@; $base= 'o=SomeCompany, ou=Members'; $surname = 'McDonalds'; $searchstring = "sn=$surname"; $result = $ldap->search( base => "$base", filter => "$searchstring", timelimit => '10', ); $result->code && die $result->error; $Number_of_Entries = $result->count; &handle_entries unless ( $Number_of_Entries == 0); If the surname exists everything works fine. But the query won't time out when there is no result. I've tried the $SIG{ALRM} approach, too. Enviroment: MS-LDAP Net::LDAP 0.19 on a Red-Hat Linux-Box Tia Thomas |