while(my $data=$sth->fetchrow_arrayref) { print join(', ',@$data)."\n"; # mehr code ... }