Perlfunc: is_leap_year
Is the given year a leap year. Simple.
sub is_leap_year() {
my $year = shift();
if ($year % 400 == 0) { return 1; }
elsif ($year % 100 == 0) { return 0; }
elsif ($year % 4 == 0) { return 1; }
else { return 0; }
}