in reply to Calculating a persons age based on their birthday.

IMHO a better way to tell if someone's age in years is to calc this way:
use integer; # speeds up the math my @date = localtime(time); # convert year to months and add current number of months my $yearnow = ((($date[5] + 1900) * 12) + ($date[4] + 1)); print "Enter an 8 digit birthdate. eg: 01/01/1970\n"; my ($monththen, $daythen, $yearthen) = split /\//, <STDIN>; # we'll fly without error-checking now and just add what they e +ntered for month my $modyearthen = (($yearthen * 12) + ($monththen)); # subtract the totals and divide by 12, convert to int (redunda +nt for safety sake) # and voila actual number of years alive $numyears = int (($yearnow - $modyearthen)/12); print "You've been around $numyears years!\n";

This way, you are also accounting for the months. For example, I was born in
August, and if you just subtract the years from each other right now, it says I'm 25,
which isn't right. You need to account for the total number of months, and then take
the integer part of the division by 12 which gives you the year and remainder. It's more
work, but it's a hair more accurate. Certainly for the sake of accuracy, you could take
it down to days...but I'll leave that to someone else! :)