my @hosts = ('ldap0:80','ldap:3','ldap2:23'); foreach my $host (@hosts) { my $ldap_conn = new Mozilla::LDAP::Conn(split':',$host) }