(["a","b","c"] ["a","b","d"]) #### a b c,d #### a b b a b d #### my arr_ref= $sth->fetchall_arrayref(); foreach my $row(@$arr_ref) { #missing something here my ($ele1,$ele2,$ele3)= @$row; print "$ele1\t", print "$ele2\t", print "$ele3\n", }