Unfortunately, this isn't thorough. Leap years don't occur if the year is a centennial year (although they do occur every 4th century). Here is what we in some of the NMS scripts:
sub is_leap { my $y = shift; return (!($y % 100) && !($y % 400)) || (($y % 100) && !($y % 4)); } [download]
sub is_leap { my $y = shift; return 0 if $y % 4; # not multiple of 4 return 1 unless $y % 400; # is multiple of 400 return 0 unless $y % 100; # is multiple of 100 return 1; # everything else } [download]
-- Randal L. Schwartz, Perl hacker