aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2021-02-10 18:43:41 +0100
committerAbigail <abigail@abigail.be>2021-02-10 19:20:37 +0100
commit7104bcff280dafd9dce7551e2ed7d7468b943003 (patch)
treeb3f184bd7b01599abcd720dd44f25aa6839a2ed7
parent5362b50dd2f494f19b90e99f3475159b34d09eaa (diff)
downloadperlweeklychallenge-club-7104bcff280dafd9dce7551e2ed7d7468b943003.tar.gz
perlweeklychallenge-club-7104bcff280dafd9dce7551e2ed7d7468b943003.tar.bz2
perlweeklychallenge-club-7104bcff280dafd9dce7551e2ed7d7468b943003.zip
Layout
-rw-r--r--challenge-099/abigail/perl/ch-1a.pl2
1 files changed, 2 insertions, 0 deletions
diff --git a/challenge-099/abigail/perl/ch-1a.pl b/challenge-099/abigail/perl/ch-1a.pl
index c0ff48366e..3e35ee4ee9 100644
--- a/challenge-099/abigail/perl/ch-1a.pl
+++ b/challenge-099/abigail/perl/ch-1a.pl
@@ -55,6 +55,7 @@ sub matches ($string, $pattern) {
#
# If we have exhausted the pattern, we have a match
# if, and only if, we have exhausted the string.
+ #
return length ($string) ? 0 : 1;
}
if (!length $string) {
@@ -62,6 +63,7 @@ sub matches ($string, $pattern) {
# If we have exhausted the string, then if the pattern
# starts with '*', we consume the '*' and recurse.
# Else, the match fails.
+ #
return $first_pattern eq '*' ? matches ($string, substr ($pattern, 1))
: 0;
}