aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobbie-hatley <Robbie.Hatley@gmail.com>2024-01-01 17:50:23 -0800
committerrobbie-hatley <Robbie.Hatley@gmail.com>2024-01-01 17:50:23 -0800
commit44aa730c9ec0c61fa35a035db0fc0c78cc237909 (patch)
tree71d94f5ae8e68c4665bda7fb51d0988619193397
parent3a6953710b5bc3265b5de040d0d2e7f1d5a61d1d (diff)
downloadperlweeklychallenge-club-44aa730c9ec0c61fa35a035db0fc0c78cc237909.tar.gz
perlweeklychallenge-club-44aa730c9ec0c61fa35a035db0fc0c78cc237909.tar.bz2
perlweeklychallenge-club-44aa730c9ec0c61fa35a035db0fc0c78cc237909.zip
Fixed error in 250-2.
-rwxr-xr-xchallenge-250/robbie-hatley/perl/ch-2.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-250/robbie-hatley/perl/ch-2.pl b/challenge-250/robbie-hatley/perl/ch-2.pl
index 39c22eb77e..07ab378791 100755
--- a/challenge-250/robbie-hatley/perl/ch-2.pl
+++ b/challenge-250/robbie-hatley/perl/ch-2.pl
@@ -77,13 +77,13 @@ BEGIN {$t0 = time}
# Is a given array ref a ref to a non-empty array containing only alphanumeric strings?
sub is_array_of_alnums ($aref) {
'ARRAY' ne ref($aref) || 0 == scalar(@$aref) and return 0;
- for (@$aref) {!/^[[:alnum:]]+$/ and return 0}
+ for (@$aref) {!/^[a-zA-Z0-9]+$/ and return 0}
return 1;
}
# What is the "alphanumeric string value" of a given scalar?
sub alnum_string_value ($x) {
- $x=~/^[[[:digit:]]+$/ and return 0+$x or return length($x);
+ $x=~/^[0-9]+$/ and return 0+$x or return length($x);
}
# What is the maximum "alphanumeric string value"