$a[$#a-1]=~/.*?(\d+)%.*/; # Get the Packet loss near the % my $pl=$1; my $rtt=(split'/',(split'=',$a[$#a])[1])[1]; # get the average Round trip time