diff options
| -rwxr-xr-x | challenge-237/robbie-hatley/perl/ch-1.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-237/robbie-hatley/perl/ch-1.pl b/challenge-237/robbie-hatley/perl/ch-1.pl index 87b0c6968b..718b5d6635 100755 --- a/challenge-237/robbie-hatley/perl/ch-1.pl +++ b/challenge-237/robbie-hatley/perl/ch-1.pl @@ -98,8 +98,8 @@ sub is_leap_year ($year) { sub days_per_month ($year, $month) { state @dpm = (31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); - if ( 2 == $month ) { return (is_leap_year($year) ? 29 : 28);} - else {return $dpm[$month];} + if ( is_leap_year($year) ) {$dpm[1]=29} else {$dpm[1]=28} + return $dpm[$month]; } # end sub days_per_month sub suffix ($x) { |
