while(my $line = ) { chomp $line; my @data; if( @data = $line =~ /^(.*?)\s+(\d{4})\s*(.+?)\s*$/ and push(@data,split(/\s+/,pop(@data))) > 8 ) { push @$res, \@data; } else { warn(qq(line "$line" not martch!\n))} }