foreach my $attribute (@data_in_attributes) { if ($attribute =~ m/$spec_all_attributes[$attribute_position][1]/) { # validate data attribute type by performing # lookup for the regular expression from the spec memory structure push (@data_out_attributes, $attribute); # Correct data type, the output value is same as input value } else { push (@data_out_attributes, $spec_all_attributes[$attribute_position][2]); # Bad data type, use default provided in the spec for output value $total_errors++; print log_file "Error ", $total_errors, ". Data type error on line: ", $line_number, ", attribute: ", $attribute_position + 1, " (", $spec_all_attributes[$attribute_position][0], ")\n"; } last DATALINE if ($total_errors >= $max_errors); # terminate if too many errors $attribute_position++; }