At 2001-06-12 03:50:13, njs@has-96-90.reshall.berkeley.edu wrote: > > That is, if $^S is mentioned inside an eval {} or "", then $^S is left > set after the eval block has ended. The appended patch (to perl-current) should fix this. - ams --- perl/mg.c~ Tue Jun 12 17:19:08 2001 +++ perl/mg.c Tue Jun 12 17:19:56 2001 @@ -581,6 +581,8 @@ (void)SvOK_off(sv); else if (PL_in_eval) sv_setiv(sv, PL_in_eval & ~(EVAL_INREQUIRE)); + else + sv_setiv(sv, 0); } break; case '\024': /* ^T */ --- perl/t/op/magic.t~ Tue Jun 12 17:31:36 2001 +++ perl/t/op/magic.t Tue Jun 12 17:32:20 2001 @@ -27,7 +27,7 @@ $Is_Cygwin = $^O eq 'cygwin'; $PERL = ($Is_MSWin32 ? '.\perl' : './perl'); -print "1..38\n"; +print "1..40\n"; eval '$ENV{"FOO"} = "hi there";'; # check that ENV is inited inside eval if ($Is_MSWin32) { ok 1, `cmd /x /c set FOO` eq "FOO=hi there\n"; } @@ -247,3 +247,6 @@ open(FOO, "nonesuch"); # Generate ENOENT my %errs = %{"!"}; # Cause Errno.pm to be loaded at run-time ok 38, ${"!"}{ENOENT}; + +ok 39, $^S == 0; +eval { ok 40, $^S };Thread Previous | Thread Next