#!/usr/bin/perl use strict; use warnings; use DBI; unlink 'results'; open my $resFile, '>', 'results'; print $resFile <connect("DBI:CSV:") or die $DBI::errstr; my $sth = $dbh->prepare("SELECT * FROM results"); $sth->execute(); my $arrayRef = $sth->fetchall_arrayref; print +(join ', ', @$_), "\n" for @$arrayRef; exit;