my $cmd = "ping $_ >c:\temp\log.txt"; print "About to run [$cmd]\n"; system($cmd) == 0 or die "Couldn't run [$cmd]: $!/$?/$^E";