chiark / gitweb /
commitid.scad.pl: Use m//g to split up for S
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 18:27:42 +0000 (18:27 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 18:27:42 +0000 (18:27 +0000)
commitid.scad.pl

index 5a61f415fdc353002336ed71a73645bf7bc8c88a..c09ce6ab4f635c64a7a0f33b074aee0c525330c0 100755 (executable)
@@ -274,7 +274,8 @@ sub gentextmodule_plusq ($$) {
     my $l = length $s;
     gentextmodule($form, $s);
     if (!($l & 1) && $l>=4) {
-       gentextmodule("${form}S", substr($s,0,$l/2), substr($s,$l/2));
+       my $e = $l/2;
+       gentextmodule("${form}S", $s =~ m/.{$e}/g);
     } else {
        $gtm_demo_j++;
     }