aboutsummaryrefslogtreecommitdiff
path: root/challenge-237
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2023-10-08 23:26:00 +0100
committerGitHub <noreply@github.com>2023-10-08 23:26:00 +0100
commit61216ee5b59f80bdbddca238fe7c59224feff65b (patch)
tree9baeb43f31c4b71214970563d3d3b6a61bda28cf /challenge-237
parent7e8d7ba5949ed128d89c2e4280d4134e817432ad (diff)
parent3f124f4379aff072e6cb01b9a18dc174d3b924da (diff)
downloadperlweeklychallenge-club-61216ee5b59f80bdbddca238fe7c59224feff65b.tar.gz
perlweeklychallenge-club-61216ee5b59f80bdbddca238fe7c59224feff65b.tar.bz2
perlweeklychallenge-club-61216ee5b59f80bdbddca238fe7c59224feff65b.zip
Merge pull request #8832 from robbie-hatley/237
Fixed some errors.
Diffstat (limited to 'challenge-237')
-rwxr-xr-xchallenge-237/robbie-hatley/perl/ch-1.pl4
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) {