Subject: | patch for use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; |
Hi.
setting env var PERL_ENCODE_DEBUG is faster than editing 1-6 files
so here is a patch for
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
thanks
Subject: | Encode-2.43-debug.patch.txt |
diff -ruN Encode-2.43-orig/Encode.pm Encode-2.43/Encode.pm
--- Encode-2.43-orig/Encode.pm 2011-05-21 16:14:46.000000000 -0700
+++ Encode-2.43/Encode.pm 2011-07-24 04:50:38.187500000 -0700
@@ -5,7 +5,7 @@
use strict;
use warnings;
our $VERSION = sprintf "%d.%02d", q$Revision: 2.43 $ =~ /(\d+)/g;
-sub DEBUG () { 0 }
+use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use XSLoader ();
XSLoader::load( __PACKAGE__, $VERSION );
diff -ruN Encode-2.43-orig/encoding.pm Encode-2.43/encoding.pm
--- Encode-2.43-orig/encoding.pm 2011-05-21 16:14:45.000000000 -0700
+++ Encode-2.43/encoding.pm 2011-07-24 04:50:38.203125000 -0700
@@ -6,7 +6,7 @@
use strict;
use warnings;
-sub DEBUG () { 0 }
+use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
BEGIN {
if ( ord("A") == 193 ) {
diff -ruN Encode-2.43-orig/lib/Encode/Alias.pm Encode-2.43/lib/Encode/Alias.pm
--- Encode-2.43-orig/lib/Encode/Alias.pm 2011-05-21 16:14:48.000000000 -0700
+++ Encode-2.43/lib/Encode/Alias.pm 2011-07-24 04:50:38.218750000 -0700
@@ -3,7 +3,7 @@
use warnings;
no warnings 'redefine';
our $VERSION = do { my @r = ( q$Revision: 2.14 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
-sub DEBUG () { 0 }
+use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use base qw(Exporter);
diff -ruN Encode-2.43-orig/lib/Encode/Encoder.pm Encode-2.43/lib/Encode/Encoder.pm
--- Encode-2.43-orig/lib/Encode/Encoder.pm 2011-05-21 16:14:48.000000000 -0700
+++ Encode-2.43/lib/Encode/Encoder.pm 2011-07-24 04:50:38.218750000 -0700
@@ -11,7 +11,7 @@
our @EXPORT_OK = qw ( encoder );
our $AUTOLOAD;
-sub DEBUG () { 0 }
+use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
use Encode qw(encode decode find_encoding from_to);
use Carp;
diff -ruN Encode-2.43-orig/lib/Encode/Guess.pm Encode-2.43/lib/Encode/Guess.pm
--- Encode-2.43-orig/lib/Encode/Guess.pm 2011-05-21 16:14:45.000000000 -0700
+++ Encode-2.43/lib/Encode/Guess.pm 2011-07-24 04:50:38.296875000 -0700
@@ -5,7 +5,7 @@
our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
my $Canon = 'Guess';
-sub DEBUG () { 0 }
+use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
our %DEF_SUSPECTS = map { $_ => find_encoding($_) } qw(ascii utf8);
$Encode::Encoding{$Canon} = bless {
Name => $Canon,