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 5a61f41..c09ce6a 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++;
     }