Skip navigation.
Home
Your source for Perl tips, howto's, faq and tutorials
( categories: )

Use the 'leap_year' function from Date::Calc module. The function returns true if the argument is a leap year, false otherwise.

Example:

#!/usr/bin/perl
 
use Date::Calc qw(leap_year);
 
$year = 2000;
print "$year is a leap year\n" if ( leap_year($year) );