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.
if (not @_) {
carp("`use charnames' needs explicit imports list");
}
- $^H |= $charnames::hint_bits;
$^H{charnames} = \&charnames ;
##
translations (inside the scope which C<use>s the module) with the
following magic incantation:
- use charnames (); # for $charnames::hint_bits
sub import {
shift;
- $^H |= $charnames::hint_bits;
$^H{charnames} = \&translator;
}
package open;
use warnings;
-$open::hint_bits = 0x20000; # HINT_LOCALIZE_HH
our $VERSION = '1.05';
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);
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 {
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 {
# 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
our $VERSION = '1.04';
-$overload::hint_bits = 0x20000; # HINT_LOCALIZE_HH
-
sub nil {}
sub OVERLOAD {
}
else {
$^H{$_[0]} = $_[1];
- $^H |= $constants{$_[0]} | $overload::hint_bits;
+ $^H |= $constants{$_[0]};
}
shift, shift;
}