for(@host){ $stout = run($_); exit unless($stout == 256); print "$_ not responding, trying next host\n"; } print "all hosts not responding";