diff options
| author | robbie-hatley <Robbie.Hatley@gmail.com> | 2023-12-01 19:09:30 -0800 |
|---|---|---|
| committer | robbie-hatley <Robbie.Hatley@gmail.com> | 2023-12-01 19:09:30 -0800 |
| commit | 1f42ea705a1cc228d3d46b50b6e3d2b6f0480d19 (patch) | |
| tree | 853a3032b7cb0c5ee506e562775c2cdaba34ac7c | |
| parent | 963eb9901b599278839391b810cb51ad02f368cb (diff) | |
| download | perlweeklychallenge-club-1f42ea705a1cc228d3d46b50b6e3d2b6f0480d19.tar.gz perlweeklychallenge-club-1f42ea705a1cc228d3d46b50b6e3d2b6f0480d19.tar.bz2 perlweeklychallenge-club-1f42ea705a1cc228d3d46b50b6e3d2b6f0480d19.zip | |
Fixed RE error in 245-1.
| -rwxr-xr-x | challenge-245/robbie-hatley/perl/ch-1.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-245/robbie-hatley/perl/ch-1.pl b/challenge-245/robbie-hatley/perl/ch-1.pl index 900ec850f9..daccc6014f 100755 --- a/challenge-245/robbie-hatley/perl/ch-1.pl +++ b/challenge-245/robbie-hatley/perl/ch-1.pl @@ -42,7 +42,7 @@ IO NOTES: Input is via either built-in variables or via @ARGV. If using @ARGV, provide one argument which must be a double-quoted array of arrays of two arrays, with the inner array pairs consisting of an array of single-quoted strings followed by an array of small positive integers (1-9), in proper Perl syntax, like so: -./ch-1.pl "([['Go','Lisp','AutoIt3','Logo'],[2, 1, 4, 3]],[['Awk','Cobol','Perl','Sed'],[3,4,1,2]])" +./ch-1.pl "([['Go','Lisp','AutoIt3','Logo'],[2, 1, 4, 3]],[['Awk','Cobol','Perl','Sed'],['golf','quaint','broad','easy']])" Output is to STDOUT and will be each input array followed by the corresponding output. @@ -70,7 +70,7 @@ BEGIN {$t0 = time} sub is_array_of_numbers($aref) { return 0 if 'ARRAY' ne ref $aref; for (@$aref) { - return 0 if !/^0$|^-?0\.[0-9]+$|^-?[1-9]\d*(?:\.[0-9]+)$/; + return 0 if !/^0$|^-?0\.[0-9]+$|^-?[1-9]\d*(?:\.[0-9]+)*$/; } return 1; } |
