In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/ce066323ce88fe6eb1c3b6b47c227f9b03ca1cef?hp=63f9ec3008baf7d655f1b9c0f2c6f81f970c65f0>

- Log -----------------------------------------------------------------
commit ce066323ce88fe6eb1c3b6b47c227f9b03ca1cef
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Thu Nov 17 15:53:18 2011 -0800

    Localise $/ properly in UCD.pm
    
    Localisation of $/ in the module’s main CV is undone once the module
    finishes loading, and hence has no effect on its function after that.
    Each function that uses readline has to localise $/ itself.
-----------------------------------------------------------------------

Summary of changes:
 lib/Unicode/UCD.pm |    8 +++++---
 lib/Unicode/UCD.t  |    3 +++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm
index af1391a..e1a6cdb 100644
--- a/lib/Unicode/UCD.pm
+++ b/lib/Unicode/UCD.pm
@@ -8,9 +8,6 @@ use Unicode::Normalize qw(getCombinClass NFD);
 
 our $VERSION = '0.37';
 
-local $_;
-local $/ = "\n";
-
 use Storable qw(dclone);
 
 require Exporter;
@@ -569,6 +566,7 @@ sub _charblocks {
     unless (@BLOCKS) {
        if (openunicode(\$BLOCKSFH, "Blocks.txt")) {
            local $_;
+           local $/ = "\n";
            while (<$BLOCKSFH>) {
                if (/^([0-9A-F]+)\.\.([0-9A-F]+);\s+(.+)/) {
                    my ($lo, $hi) = (hex($1), hex($2));
@@ -1001,6 +999,7 @@ sub _casefold {
     unless (%CASEFOLD) {
        if (openunicode(\$CASEFOLDFH, "CaseFolding.txt")) {
            local $_;
+           local $/ = "\n";
            while (<$CASEFOLDFH>) {
                if (/^([0-9A-F]+); ([CFIST]); ([0-9A-F]+(?: [0-9A-F]+)*);/) {
                    my $code = hex($1);
@@ -1163,6 +1162,7 @@ sub _casespec {
     unless (%CASESPEC) {
        if (openunicode(\$CASESPECFH, "SpecialCasing.txt")) {
            local $_;
+           local $/ = "\n";
            while (<$CASESPECFH>) {
                if (/^([0-9A-F]+); ([0-9A-F]+(?: [0-9A-F]+)*)?; ([0-9A-F]+(?: 
[0-9A-F]+)*)?; ([0-9A-F]+(?: [0-9A-F]+)*)?; (\w+(?: \w+)*)?/) {
                    my ($hexcode, $lower, $title, $upper, $condition) =
@@ -1259,6 +1259,7 @@ sub _namedseq {
     unless (%NAMEDSEQ) {
        if (openunicode(\$NAMEDSEQFH, "Name.pl")) {
            local $_;
+           local $/ = "\n";
            while (<$NAMEDSEQFH>) {
                if (/^ [0-9A-F]+ \  /x) {
                     chomp;
@@ -3028,6 +3029,7 @@ my $UNICODEVERSION;
 sub UnicodeVersion {
     unless (defined $UNICODEVERSION) {
        openunicode(\$VERSIONFH, "version");
+       local $/ = "\n";
        chomp($UNICODEVERSION = <$VERSIONFH>);
        close($VERSIONFH);
        croak __PACKAGE__, "::VERSION: strange version '$UNICODEVERSION'"
diff --git a/lib/Unicode/UCD.t b/lib/Unicode/UCD.t
index b904d9a..6d8c628 100644
--- a/lib/Unicode/UCD.t
+++ b/lib/Unicode/UCD.t
@@ -19,6 +19,8 @@ use Test::More;
 
 use Unicode::UCD 'charinfo';
 
+$/ = 7;
+
 my $charinfo;
 
 is(charinfo(0x110000), undef, "Verify charinfo() of non-unicode is undef");
@@ -549,6 +551,7 @@ is_deeply(\@list,
 # Get the official Unicode property name synonyms and test them.
 open my $props, "<", "../lib/unicore/PropertyAliases.txt"
                 or die "Can't open Unicode PropertyAliases.txt";
+$/ = "\n";
 while (<$props>) {
     s/\s*#.*//;           # Remove comments
     next if /^\s* $/x;    # Ignore empty and comment lines

--
Perl5 Master Repository

Reply via email to