while (my $row = $sth->fetchrow_arrayref) { foreach ($row){ if (! ref($row)) { next; } print @$row, "\n"; } } #### "select program, day, time from TVviewingsked where name = "Frank"