aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-110/cheok-yin-fung/perl/ch-1.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/challenge-110/cheok-yin-fung/perl/ch-1.pl b/challenge-110/cheok-yin-fung/perl/ch-1.pl
index a036df0b9f..e6340acc04 100644
--- a/challenge-110/cheok-yin-fung/perl/ch-1.pl
+++ b/challenge-110/cheok-yin-fung/perl/ch-1.pl
@@ -8,7 +8,9 @@ use warnings;
my $s;
while ($s = <STDIN>) {
chomp($s);
- if (substr($s, -11) =~ / \d{10}/ &&
+ if ( length $s == 15 &&
+ substr($s, 4, 1) eq " " &&
+ substr($s, -11) =~ / \d{10}/ &&
(substr($s,0,4) =~ /\d{4}/ ||
substr($s,0,4) =~ /\+\d{2}/ ||
substr($s,0,4) =~ /\(\d{2}\)/)