Let's try this again. This script calls "ping.exe" and directs its output using "|" throught the FileHandle "pingname".

SRV: foreach $server (@Servers)
{
   chomp($server);
   open (pingname, "ping $server|") || die "Can not ping";
   while ($line = <pingname>)
   {
      chomp($line);
      print "$line";
      if ($line =~ /Reply\s/)
      {
        print OUTFILE "$server\tActive\n";
        print " - Active\n";
        next SRV;
      }
      if ($line =~ /Bad IP\s/)
      {
         print " - Bad IP\n";
         print OUTFILE "$server\tBad IP\n";
         next SRV;
              
}
      if ($line =~ /Request timed out/)
      {
         print " - Bad IP\n";
         print OUTFILE "$server\tBad IP\n";
         next SRV;
      }
   }
}

Close SERVER;
Close OUTPUT;


[ 10 June 2002, 15:16: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/