From: Nicholas Clark Date: Thu, 20 Apr 2006 21:27:21 +0000 (+0000) Subject: Remove the last traces of explicitly setting HINT_LOCALIZE_HH from X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f22a20695eae00da6d6892456727b75f7267e9ea;p=p5sagit%2Fp5-mst-13.2.git Remove the last traces of explicitly setting HINT_LOCALIZE_HH from perl modules. p4raw-id: //depot/perl@27927 --- diff --git a/lib/charnames.pm b/lib/charnames.pm index 54f5179..00faa69 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -5,7 +5,6 @@ use File::Spec; our $VERSION = '1.05'; use bytes (); # for $bytes::hint_bits -$charnames::hint_bits = 0x20000; # HINT_LOCALIZE_HH my %alias1 = ( # Icky 3.2 names with parentheses. @@ -192,7 +191,6 @@ sub import if (not @_) { carp("`use charnames' needs explicit imports list"); } - $^H |= $charnames::hint_bits; $^H{charnames} = \&charnames ; ## @@ -393,10 +391,8 @@ hardwired into F. A module can install custom translations (inside the scope which Cs the module) with the following magic incantation: - use charnames (); # for $charnames::hint_bits sub import { shift; - $^H |= $charnames::hint_bits; $^H{charnames} = \&translator; } diff --git a/lib/open.pm b/lib/open.pm index c2eae57..d384b41 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -1,6 +1,5 @@ package open; use warnings; -$open::hint_bits = 0x20000; # HINT_LOCALIZE_HH our $VERSION = '1.05'; @@ -57,7 +56,6 @@ sub import { my ($class,@args) = @_; croak("open: needs explicit list of PerlIO layers") unless @args; my $std; - $^H |= $open::hint_bits; my ($in,$out) = split(/\0/,(${^OPEN} || "\0"), -1); while (@args) { my $type = shift(@args); diff --git a/lib/open.t b/lib/open.t index 554798b..5c4c875 100644 --- a/lib/open.t +++ b/lib/open.t @@ -7,7 +7,7 @@ BEGIN { require Config; import Config; } -use Test::More tests => 16; +use Test::More tests => 14; # open::import expects 'open' as its first argument, but it clashes with open() sub import { @@ -22,10 +22,6 @@ eval { import() }; like( $@, qr/needs explicit list of PerlIO layers/, 'import should fail without args' ); -# the hint bits shouldn't be set yet -is( $^H & $open::hint_bits, 0, - 'hint bits should not be set in $^H before open import' ); - # prevent it from loading I18N::Langinfo, so we can test encoding failures my $warn; local $SIG{__WARN__} = sub { @@ -48,8 +44,6 @@ like( $warn, qr/Unknown PerlIO layer/, # see if it sets the magic variables appropriately import( 'IN', ':crlf' ); -ok( $^H & $open::hint_bits, - 'hint bits should be set in $^H after open import' ); is( $^H{'open_IN'}, 'crlf', 'should have set crlf layer' ); # it should reset them appropriately, too diff --git a/lib/overload.pm b/lib/overload.pm index 35c090b..0120882 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -2,8 +2,6 @@ package overload; our $VERSION = '1.04'; -$overload::hint_bits = 0x20000; # HINT_LOCALIZE_HH - sub nil {} sub OVERLOAD { @@ -149,7 +147,7 @@ sub constant { } else { $^H{$_[0]} = $_[1]; - $^H |= $constants{$_[0]} | $overload::hint_bits; + $^H |= $constants{$_[0]}; } shift, shift; }