use DateTime;
my $y = 1900;

if (DateTime->new(year => $y)->is_leap_year) {
  print "$y is a leap year.\n";
} else {
  print "$y is a common year.\n";
}

こうですか? よくわかりません><