Qt Code:
  1. my $v1 =0;
  2. my $v2=0;
  3. # match all lines that end with two numbers
  4. # (note: only unsigned integers are matched, not floats like 2.3, -3.4, 2e-3 ...!)
  5. if ($_ =~ m/.*/\s+(\d+)\s+(\d+)\s*$/)
  6. {
  7. $v1 = $1;
  8. $v2 = $2;
  9.  
  10. if ( $v2 < 1) {
  11. ...
To copy to clipboard, switch view to plain text mode 

If you need to match not only integers the you need to replace the (\d+) by more complicated regexs for whatever numbers you need to match. See, e.g. http://docstore.mik.ua/orelly/perl/cookbook/ch02_02.htm

HTH