while (my $track_ref = $sth->fetchrow_arrayref ()) { print $$track_ref[0]; # This prints the first field print $$track_ref[1]; # This prints the second field # ...and so on }