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); } #### Expected fields to be an array ref at /cluster/uapp/app/bin/mytest.pl line 58. ##Line 58 is this one-->> " $csv->print (*STDOUT, $_read_sth->{NAME});