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 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; 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));