$data =~ /RX bytes\:(\d+) .*TX bytes\:(\d+) .*/; my $recv = $1/1024; my $sent=$2/1024; $recv =~ s/\..*//; $sent =~ s/\..*//;