aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-282/cheok-yin-fung/perl/ch-2.pl1
1 files changed, 1 insertions, 0 deletions
diff --git a/challenge-282/cheok-yin-fung/perl/ch-2.pl b/challenge-282/cheok-yin-fung/perl/ch-2.pl
index 276e97afb5..ed2afa15b3 100644
--- a/challenge-282/cheok-yin-fung/perl/ch-2.pl
+++ b/challenge-282/cheok-yin-fung/perl/ch-2.pl
@@ -6,6 +6,7 @@ use List::Util qw/reduce/;
sub ck {
my $str = $_[0];
+ return 0 if $str eq "";
$str = lc $str;
my @alphabets = split "", $str;
my $abc = reduce { substr($a,-1) eq $b ? $a : $a.$b } @alphabets;