my $result = `ping host 2>&1`; #### system("ping host >result.txt 2>&1");