aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-100/yet-ebreo/perl/ch-1.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/challenge-100/yet-ebreo/perl/ch-1.pl b/challenge-100/yet-ebreo/perl/ch-1.pl
index 515b224531..569125e669 100644
--- a/challenge-100/yet-ebreo/perl/ch-1.pl
+++ b/challenge-100/yet-ebreo/perl/ch-1.pl
@@ -14,9 +14,12 @@ use feature qw(say);
# Output: 07:15 pm or 07:15pm
#one-liner? sure thing! :D
-sub f { pop=~/:.. */&&sprintf"%02d%s",$`%12+12*($'?'pm'eq$':!($`%12)),$&.($`<12?'am':'pm')x!$' }
+sub f { pop=~/:.. */&&sprintf"%02d%s",$`%12+12*($'?'pm'eq$':$`%12<1),$&.($`<12?'am':'pm')x!$' }
say &f('01:00 pm');
say &f('12:01 am');
+say &f('12:00 pm');
+say &f('12:00 am');
say &f('13:00');
say &f('00:00');
+say &f('19:15');