What text does ping return? On Win32 it returns blah blah blah time=123ms so we match on the "time=123ms" bit. If the ping output format is different (as it will be on *nix) you just need to modify the regex. Post some sample ping output as captured by this sort of call (or whatever you are using) $ping = `ping`; print $ping and it will be easy to munge the times out of the return strings.
You have lost the /g off my regex when you modified it so you only match the first time=87.719 Thus the array only gets this one element. The /g makes it match all the time=nn.nnn and return them to the array. Make the regex @times = $ping =~ /time=(\d+\.\d+)/g; like it was and it will work fine. BTW if you use a char class like this /time=([\d\.]+)/g you are more flexible as you don't insist on the decimal point.