|
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"; } } |
- RE: Run system() on an array of computers Guess_Who344
- RE: Run system() on an array of computers King, Jason G
