my $csv = Text::CSV_XS->new ({ binary => 1, eol => "\r\n" }); $csv->print (*STDOUT, $_read_sth->{NAME}); while (my $row = $_read_sth->fetchall_arrayref) { ##Do I need the Dumper function here? as I am supposed to print multiple resultsets and each has a different heading? $csv->print (*STDOUT, $row); }