From 2c108c4b0a8ff35440b6a702049a6526c9412fdd Mon Sep 17 00:00:00 2001 From: Pali Date: Wed, 7 Jun 2017 22:52:21 +0200 Subject: [PATCH 1/3] Add missing comma in usage of encoding pragma description --- encoding.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoding.pm b/encoding.pm index 640a90c..3c8d6a7 100644 --- a/encoding.pm +++ b/encoding.pm @@ -371,7 +371,7 @@ Note that C WILL NOT be changed, regardless. Also note that non-STD file handles remain unaffected. Use C or C to change the layers of those. -=item C Filter=E1;> +=item C, Filter=E1;> This operates as above, but the C argument with a non-zero value causes the entire script, and not just literals, to be translated from From 04d7bbff90a84752c89f760fe06c13c89d7bdf74 Mon Sep 17 00:00:00 2001 From: Pali Date: Wed, 7 Jun 2017 22:54:33 +0200 Subject: [PATCH 2/3] In Encode::Encoding initialize DEBUG constant function properly Like in other Encode modules, initialize it from PERL_ENCODE_DEBUG environmental variable and use constant to make it inlined. --- lib/Encode/Encoding.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Encode/Encoding.pm b/lib/Encode/Encoding.pm index 1df2140..923e05d 100644 --- a/lib/Encode/Encoding.pm +++ b/lib/Encode/Encoding.pm @@ -11,7 +11,7 @@ use Carp (); use Encode (); use Encode::MIME::Name; -sub DEBUG { 0 } +use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; sub Define { my $obj = shift; From 647371a72d3dbd05c851aa638244ce7b97f9724c Mon Sep 17 00:00:00 2001 From: Pali Date: Wed, 7 Jun 2017 22:55:10 +0200 Subject: [PATCH 3/3] In test t/guess.t call use_ok in BEGIN block and remove dead code use_ok must be used in BEGIN block, otherwise it would not work correctly. --- t/guess.t | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/t/guess.t b/t/guess.t index 81ab91b..896028b 100644 --- a/t/guess.t +++ b/t/guess.t @@ -18,11 +18,7 @@ use Encode qw(decode encode find_encoding _utf8_off); #use Test::More qw(no_plan); use Test::More tests => 32; -use_ok("Encode::Guess"); -{ - no warnings; - $Encode::Guess::DEBUG = shift || 0; -} +BEGIN { use_ok("Encode::Guess") } my $ascii = join('' => map {chr($_)}(0x21..0x7e)); my $latin1 = join('' => map {chr($_)}(0xa1..0xfe));