Change 33486 by [EMAIL PROTECTED] on 2008/03/12 08:50:11

        An unfortunate side-effect of Encode and Encode::Alias use'ing each
        other, and Encode::Alias exporting functions into Encode for it to use
        as methods, broke the loading of the find_alias() Encode method in some
        cases since 5.10. Breaking the recursive inheritance fixes it.

Affected files ...

... //depot/perl/ext/Encode/lib/Encode/Alias.pm#41 edit
... //depot/perl/lib/open.t#28 edit

Differences ...

==== //depot/perl/ext/Encode/lib/Encode/Alias.pm#41 (text) ====
Index: perl/ext/Encode/lib/Encode/Alias.pm
--- perl/ext/Encode/lib/Encode/Alias.pm#40~30866~       2007-04-07 
05:45:44.000000000 -0700
+++ perl/ext/Encode/lib/Encode/Alias.pm 2008-03-12 01:50:11.000000000 -0700
@@ -2,8 +2,7 @@
 use strict;
 use warnings;
 no warnings 'redefine';
-use Encode;
-our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . 
"%02d" x $#r, @r };
+our $VERSION = '2.07_01'; #do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); 
sprintf "%d." . "%02d" x $#r, @r };
 sub DEBUG () { 0 }
 
 use base qw(Exporter);
@@ -20,6 +19,7 @@
 our %Alias;    # cached known aliases
 
 sub find_alias {
+    require Encode;
     my $class = shift;
     my $find  = shift;
     unless ( exists $Alias{$find} ) {
@@ -128,6 +128,7 @@
 }
 
 sub init_aliases {
+    require Encode;
     undef_aliases();
 
     # Try all-lower-case version should all else fails

==== //depot/perl/lib/open.t#28 (text) ====
Index: perl/lib/open.t
--- perl/lib/open.t#27~28693~   2006-08-10 09:46:07.000000000 -0700
+++ perl/lib/open.t     2008-03-12 01:50:11.000000000 -0700
@@ -7,7 +7,7 @@
        require Config; import Config;
 }
 
-use Test::More tests => 22;
+use Test::More tests => 23;
 
 # open::import expects 'open' as its first argument, but it clashes with open()
 sub import {
@@ -181,6 +181,11 @@
     }
 }
 
+{
+    eval q[use Encode::Alias;use open ":std", ":locale"];
+    is($@, '', 'can use :std and :locale');
+}
+
 SKIP: {
     skip("no perlio", 1) unless (find PerlIO::Layer 'perlio');
     use open IN => ':non-existent';
End of Patch.

Reply via email to