#!/usr/bin/perl # Webmaster@wickedmind.com # age.cgi - give age in months use CGI qw(:standard); $CGI_URL="http://www.wickedmind.com/cgi-bin/age.cgi"; $birthdate = param("birthdate"); ($year, $month) = ($birthdate =~ /^(\d\d\d\d)-(\d\d)\s*$/) or die "The birthdate was not in the YYYY-MM format.\n"; ($this_year, $this_month) = (localtime)[5,4]; $this_year += 1900; # localtime returns year-1900, e.g. 100 for year 2000 $year_diff = $this_year-$year; $month_diff = $this_month-$month; $difference = $year_diff*12 + $month_diff; print header(), "