I have a text file with a list of hosts that I read into the @computers array.  Any way to run a system() command for each host in the array?  Here is what I have so far:
 
foreach my $host (@computers)
     {
         # Check for blank lines
           $host =~ /\S/ or next;
 
         # Try to ping the host
         if ($p->ping($host))
          {
Here is where I would like to execute     system "net time /domain:<domain> /set /y";
for each $host
 
   

    }
   else
    {
     print "Couldn't ping $host\n";
              print LOGFILE "Couldn't ping $host\n";
    }
  }

Reply via email to