Thanks. That worked.
Chris Ridd <[EMAIL PROTECTED]> 07/06/2007 01:14 PM To <[EMAIL PROTECTED]>, <perl-ldap@perl.org> cc Subject Re: Array Of Hosts On 6/7/07 4:34, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello all, > > Could anyone tell me how, I can have my Net LDAP script to use an array of > hosts, to connect to? > I tried the following, but it did not work. > > my @hosts = qw(host1, host2); > > my $ldconnect = Net::LDAP->new(@hosts, port=>'389') || die "$@"; RTFP ;-) --- =item new ( HOST, OPTIONS ) [...] C<HOST> may also be a reference to an array of hosts, host-port pairs or URIs to try. Each will be tried in order until a connection is made. Only when all have failed will the result of C<undef> be returned. --- So try: Net::LDAP->new([EMAIL PROTECTED], port => 389) There are a number of other documented ways to call the constructor which you might find more useful. Cheers, Chris