my $re = qr{\s+(-?\d+\.\d+)\s+(-?\d+\.\d+)}; # and then later, inside the loops next if $line !~ $re;