in reply to How to get Remote system hostnames in LAN?

if you want to capture the output from the ping command, in Windows XP, you might want to try something like this:
use warnings; use strict; # capture the output from ping my $ping = qx( ping -n 4 127.0.0.1 ); # extract the values $ping =~ m/ .* Sent \s = \s (\d+) .* Lost \s = \s ([\d\.]+) \s \( ([\d\.]+) % \s loss .* Average \s = \s ([\d\.]+) ms .* /sx ; my $sent = $1; my $loss_no = $2; my $loss_proc = $3; my $average = $4; print "Lost $loss_no packets from $sent packets ( $loss_proc % ). ", "Average RTT $average ms.\n";
you might want to take a look at the regular expressions tutorial.

:)))))