use strict; use warnings; my %people; my @sentences = ("here i am","i am me"); $people{me}[0] = 0; $people{me}[1] = "1985"; $people{me}[2] = @sentences; @sentences = ("there she is"); $people{friend}[0] = 1; $people{friend}[1] = "1984"; $people{friend}[2] = @sentences; foreach my $person ( %people) { my $rowId = $person[0]; my $dob = $person[1]; addDOBToDatabase($rowId, $dob); foreach my $sentence ( %sentences) { addSentenceToDatabase($rowId, $sentence); } }