my @res = `ping -c 3 $ip`; if (pop @res =~ /(\d+\.\d+)\/(\d+\.\d+)\/(\d+\.\d+)) { my @sorted = sort ($1,$2,$3); print pop @sorted }