/* magicalization must be done before require_tie_mod is called */
if (sv_type == SVt_PVHV || sv_type == SVt_PVGV)
+ {
+ if (addmg) (void)hv_store(stash,name,len,(SV *)gv,0);
+ addmg = 0;
require_tie_mod(gv, "!", newSVpvs("Errno"), "TIEHASH", 1);
+ }
break;
case '-': /* $- */
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
- plan (tests => 153);
+ plan (tests => 154);
}
# Test that defined() returns true for magic variables created on the fly,
}
SKIP: {
- skip_if_miniperl("miniperl can't rely on loading %Errno", 1);
+ skip_if_miniperl("miniperl can't rely on loading %Errno", 2);
# Make sure that Errno loading doesn't clobber $!
undef %Errno::;
open(FOO, "nonesuch"); # Generate ENOENT
my %errs = %{"!"}; # Cause Errno.pm to be loaded at run-time
ok ${"!"}{ENOENT};
+
+ # Make sure defined(*{"!"}) before %! does not stop %! from working
+ is
+ runperl(
+ prog => 'BEGIN { defined *{q-!-} } print qq-ok\n- if tied %!',
+ ),
+ "ok\n",
+ 'defined *{"!"} does not stop %! from working';
}
# Check that we don't auto-load packages