my $r = $dbh->selectall_arrayref("SELECT avg(...), count(1) FROM prospects"); my ($avg,$count) = @{$r->[0]};