This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Sat, 29 May 2004 21:52:37 +0000 (21:52 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 29 May 2004 21:52:37 +0000 (21:52 +0000)
[ 22771]
ensure that utf8 Perl code magically called from a regex localizes $.

[ 22772]
remove spurious intentation in utf8_pva.pl
p4raw-link: @22772 on //depot/perl: c26e4df972cbd2a5db679b77dc3c44ac64a3fc1a
p4raw-link: @22771 on //depot/perl: 21235083834316f367c5d1108a28d49dda550bb7

p4raw-id: //depot/maint-5.8/perl@22859
p4raw-integrated: from //depot/perl@22858 'copy in' lib/utf8_pva.pl
(@22771..)

lib/utf8_pva.pl

index 3cd9efd..6db881b 100644 (file)
@@ -11,45 +11,46 @@ for (@INC) {
 
 use Carp 'confess';
 
-local $_;
-
-    open PA, "< $dir/unicore/PropertyAliases.txt"
-       or confess "Can't open PropertyAliases.txt: $!";
-    while (<PA>) {
-       s/#.*//;
-       s/\s+$//;
-       next if /^$/;
-
-       my ($abbrev, $name) = split /\s*;\s*/;
-        next if $abbrev eq "n/a";
-       tr/ _-//d for $abbrev, $name;
-       $PropertyAlias{lc $abbrev} = $name;
-        $PA_reverse{lc $name} = $abbrev;
-    }
-    close PA;
-
-    open PVA, "< $dir/unicore/PropValueAliases.txt"
-       or confess "Can't open PropValueAliases.txt: $!";
-    while (<PVA>) {
-       s/#.*//;
-       s/\s+$//;
-       next if /^$/;
-
-       my ($prop, @data) = split /\s*;\s*/;
-       shift @data if $prop eq 'ccc';
-        next if $data[0] eq "n/a";
-
-       $data[1] =~ tr/ _-//d;
-       $PropValueAlias{$prop}{lc $data[0]} = $data[1];
-        $PVA_reverse{$prop}{lc $data[1]} = $data[0];
-
-       my $abbr_class = ($prop eq 'gc' or $prop eq 'sc') ? 'gc_sc' : $prop;
-       $PVA_abbr_map{$abbr_class}{lc $data[0]} = $data[0];
-    }
-    close PVA;
-
-    # backwards compatibility for L& -> LC
-    $PropValueAlias{gc}{'l&'} = $PropValueAlias{gc}{lc};
-    $PVA_abbr_map{gc_sc}{'l&'} = $PVA_abbr_map{gc_sc}{lc};
+local *_;
+local $.; # localizes Pl_last_in_gv
+
+open PA, "< $dir/unicore/PropertyAliases.txt"
+    or confess "Can't open PropertyAliases.txt: $!";
+while (<PA>) {
+    s/#.*//;
+    s/\s+$//;
+    next if /^$/;
+
+    my ($abbrev, $name) = split /\s*;\s*/;
+    next if $abbrev eq "n/a";
+    tr/ _-//d for $abbrev, $name;
+    $PropertyAlias{lc $abbrev} = $name;
+    $PA_reverse{lc $name} = $abbrev;
+}
+close PA;
+
+open PVA, "< $dir/unicore/PropValueAliases.txt"
+    or confess "Can't open PropValueAliases.txt: $!";
+while (<PVA>) {
+    s/#.*//;
+    s/\s+$//;
+    next if /^$/;
+
+    my ($prop, @data) = split /\s*;\s*/;
+    shift @data if $prop eq 'ccc';
+    next if $data[0] eq "n/a";
+
+    $data[1] =~ tr/ _-//d;
+    $PropValueAlias{$prop}{lc $data[0]} = $data[1];
+    $PVA_reverse{$prop}{lc $data[1]} = $data[0];
+
+    my $abbr_class = ($prop eq 'gc' or $prop eq 'sc') ? 'gc_sc' : $prop;
+    $PVA_abbr_map{$abbr_class}{lc $data[0]} = $data[0];
+}
+close PVA;
+
+# backwards compatibility for L& -> LC
+$PropValueAlias{gc}{'l&'} = $PropValueAlias{gc}{lc};
+$PVA_abbr_map{gc_sc}{'l&'} = $PVA_abbr_map{gc_sc}{lc};
 
 1;