--- loncom/lonnet/perl/lonnet.pm 2007/03/03 01:33:10 1.841 +++ loncom/lonnet/perl/lonnet.pm 2007/03/03 01:54:13 1.842 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.841 2007/03/03 01:33:10 albertel Exp $ +# $Id: lonnet.pm,v 1.842 2007/03/03 01:54:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7621,9 +7621,17 @@ BEGIN { my %possible_hosts = ($type eq 'library') ? %libserv : %hostname; my %result; - while ( my ($host,$hostname) = each(%possible_hosts)) { - if ($hostdom{$host} eq $domain) { - $result{$host} = $hostname; + if (ref($domain) eq 'ARRAY') { + while ( my ($host,$hostname) = each(%possible_hosts)) { + if (grep(/\Q$hostdom{$host}\E/,@$domain)) { + $result{$host} = $hostname; + } + } + } else { + while ( my ($host,$hostname) = each(%possible_hosts)) { + if ($hostdom{$host} eq $domain) { + $result{$host} = $hostname; + } } } return %result;