Subject: | [PATCH] Behavior change in range operator causes smart match to fail |
Hi,
See the discussion at [1] - because of a behavior change in the range operator[2] as of Perl 5.31.3, in lib/Spp/Builtin.pm, "$r ~~ ['0' .. '9']" no longer works as expected. The attached patch changes the test to a regular expression, since smart matching is experimental.
[1] https://github.com/Perl/perl5/issues/17256
[2] https://github.com/Perl/perl5/blob/d0e1a8734a3/pod/perl5313delta.pod#plain-0-string-now-treated-as-a-number-for-range-operator
Thanks,
-- Hauke D
Subject: | Spp-2.03.patch |
diff -ru Spp-2.03/lib/Spp/Builtin.pm Spp-2.03-patched/lib/Spp/Builtin.pm
--- Spp-2.03/lib/Spp/Builtin.pm 2017-10-14 19:32:03.000000000 +0200
+++ Spp-2.03-patched/lib/Spp/Builtin.pm 2020-02-10 20:06:58.536023305 +0100
@@ -272,7 +272,7 @@
sub is_digit {
my $r = shift;
- return $r ~~ ['0' .. '9'];
+ return $r =~ /\A[0-9]\z/;
}
sub is_xdigit {