while { $total += $_; $count++; } my $average = $total/$count;