hhh has asked for the wisdom of the Perl Monks concerning the following question:
Wonder if anyone can help me fix the following. I try to test LDAP server status by using the module Net::LDAP, I wrote the following code, executed and got the following error message.
Undefined subroutine &Net::LDAP called at ./ldap.pl line 4
When I use Unix command, I typed: ldapsearch -h host.edu "cn=administrator", it returned results, which means the server is up. What I really need is to write a perl script to test the LDAP server status. Thank you.
################################## use Net::LDAP; use strict; my $ldap = Net::LDAP->('host.edu', port => '389'); $ldap -> bind; my $mesg = $ldap -> search(base => "cn = administrator"); use Net::LDAP::Util qw(ldap_error_text); die ldap_error_text($mesg->code) if $mesg->code;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Undefined subroutine
by AgentM (Curate) on Mar 12, 2001 at 23:04 UTC | |
|
Re: Undefined subroutine
by BlueLines (Hermit) on Mar 13, 2001 at 00:43 UTC | |
by hhh (Initiate) on Mar 13, 2001 at 01:03 UTC | |
by sacked (Hermit) on Mar 13, 2001 at 03:05 UTC |