HOST: foreach $host (@hostlist) { my $timeout = 30; #connect to the remote site Log(LOGFILE, "INFO: $0::Connecting to $host"); eval { local $SIG{ALRM} = sub { die "alarm\n" }; alarm $timeout; $ibisSite=openRemoteSql($host,$mySocket,"$user","$pass"); alarm 0; }; if ($@) { Log(LOGFILE, "ERROR: $0:$host:Cant Connect to site:$@"); next HOST; }