Commit ea4bb4d420 for perl

commit ea4bb4d420902ca1dbdccdfc937aaf67bd4add29
Author: Karl Williamson <khw@cpan.org>
Date:   Mon Oct 5 05:29:59 2026 -0600

    regcharclass.pl: Replace use of $_ with lexical

    A future commit will destroy $_ before we are done with needing its
    value.

diff --git a/regcharclass.h b/regcharclass.h
index b4f7ad4ab3..3fe0a328be 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -4003,6 +4003,6 @@
  * 94644b4e53ef4f2590ef86a261dcd22ffadf79247fcc7f31c4ebf5b19111fd25 lib/unicore/mktables
  * a0079d7556b20c2de1fdc3d492797a91b8ec8a06006f94460006185cb6380962 lib/unicore/version
  * 0a6b5ab33bb1026531f816efe81aea1a8ffcd34a27cbea37dd6a70a63d73c844 regen/charset_translations.pl
- * 2e1ecbbfdbe14aff766eee0bfddcbe38e3c21d06bbb97df80f39722515531d6e regen/regcharclass.pl
+ * d5d1812fb20c5927adf1a655bfc729ee761bf087af336a24ad4423dae78dd1ae regen/regcharclass.pl
  * 1ce43daf54162d0a267412453ce2a613f60f3a7631365775cc52d34213251a83 regen/regcharclass_multi_char_folds.pl
  * ex: set ro ft=c: */
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl
index d3d434e22b..8ead4dd8b5 100755
--- a/regen/regcharclass.pl
+++ b/regen/regcharclass.pl
@@ -1599,27 +1599,28 @@ EOF
         undef %mods;
         print $out_fh "\n", get_conditional_compile_line_start($charset);
         my @data_copy = @data;
-        for (@data_copy) {
+        for (my $i = 0; $i < @data_copy; $i++) {
+            my $line = $data_copy[$i];

             # squeeze out comment and blanks
-            s/^ \s* (?: \# .* ) ? $ //x;
-            next unless /\S/;
-            chomp;
-            if ( /^[A-Z]/ ) {
+            $line =~ s/^ \s* (?: \# .* ) ? $ //x;
+            next unless $line =~ /\S/;
+            chomp $line;
+            if ($line =~ /^[A-Z]/ ) {

                 # This starts a new definition; do the previous one
                 $doit->($charset) unless $first_time;

                 $first_time = 0;
-                ( $op, $title )= split /\s*:\s*/, $_, 2;
+                ( $op, $title )= split /\s*:\s*/, $line, 2;
                 @txt= ();
-            } elsif ( s/$definition_begin_re// ) {
-                my ( $type, $modifier )= split /:/, $_;
+            } elsif ( $line =~ s/$definition_begin_re// ) {
+                my ( $type, $modifier )= split /:/, $line;
                 @types= split ' ', $type;
                 undef %mods;
                 map { $mods{$_} = 1 } split ' ',  $modifier;
             } else {
-                push @txt, "$_";
+                push @txt, $line;
             }
         }
         $doit->($charset);