in reply to Re^3: Average Age of the Perl Monk - Poll?
in thread Average Age of the Perl Monk - Poll?

merlyn,
Alternatively, your average age could be 22. Take the sum of all your ages and divide by the number of ages.
print ave_age( 43 ); sub ave_age { ($_[0] * $_[0] + $_[0]) / 2 / $_[0] }
Incidently, my average age using this formula is 14.5 which assumes you were never 0 years old.

Cheers - L~R