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 }
-- Randal L. Schwartz, Perl hacker
In reply to •Re: Re: Checking for leap year
by merlyn
in thread Checking for leap year
by joshua
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |