use XBase; ... my $new_table = XBase->create("name" => "$filename.$ext", "field_names" => @column_names, "field_types" => undef, "field_lengths" => undef, "field_decimals" => undef); my $i=0; foreach my $record (@records) { $new_table->set_record_hash($i,%$record); $i++; } $new_table->close;