... $sql = 'SELECT usagedate, title FROM songusage_query'; $sth = $dbh->prepare($sql); $sth->execute(); #print Dumper $sth->fetchall_arrayref(); my $worksheet_2 = $workbook->add_worksheet($worksheetname[1]); $worksheet_2->write_col(0, 0, $sth->fetchall_arrayref()); ...