#!/usr/bin/perl use strict; use warnings; my @dump; my $false_count = 0; open (FH, "){ if (/^.\|TOTAL.*$/i){ my @tmp = $_ =~ /([0-9\.\-]+)/g; push @dump, "@tmp"; }else{ $false_count++; } } print 'Counted matches-> '.$#dump."\tUnmatched lines-> ".$false_count."\n"; foreach (@dump){print $_."\n";}