sub get_days { if($curr_mon =~ /$three_one/) { return 31; } elsif($curr_mon =~ /$three_zero/) { return 30; } elsif($curr_mon == 2) { if (is_leap_year()) { return 29; } else { return 28; } } else { die "Bad month entered!\n"; } } sub is_leap_year { my (undef, undef, undef, undef,undef, $year) = localtime(time); $year += 1900; return 1 if ($year % 400 == 0); return 0 if ($year % 100 == 0); return 1 if ($year % 4 == 0); return 0; }