1_compile updates.
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 37c3561..d488b7c 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2894,8 +2894,6 @@ S_doeval(pTHX_ int gimme, OP** startop)
     PL_error_count = 0;
     PL_curcop = &PL_compiling;
     PL_curcop->cop_arybase = 0;
-    SvREFCNT_dec(PL_rs);
-    PL_rs = newSVpvn("\n", 1);
     if (saveop && saveop->op_flags & OPf_SPECIAL)
        PL_in_eval |= EVAL_KEEPERR;
     else
@@ -2933,8 +2931,6 @@ S_doeval(pTHX_ int gimme, OP** startop)
            Perl_croak(aTHX_ "%sCompilation failed in regexp",
                       (*msg ? msg : "Unknown error\n"));
        }
-       SvREFCNT_dec(PL_rs);
-       PL_rs = SvREFCNT_inc(PL_nrs);
 #ifdef USE_5005THREADS
        MUTEX_LOCK(&PL_eval_mutex);
        PL_eval_owner = 0;
@@ -2943,8 +2939,6 @@ S_doeval(pTHX_ int gimme, OP** startop)
 #endif /* USE_5005THREADS */
        RETPUSHUNDEF;
     }
-    SvREFCNT_dec(PL_rs);
-    PL_rs = SvREFCNT_inc(PL_nrs);
     CopLINE_set(&PL_compiling, 0);
     if (startop) {
        *startop = PL_eval_root;
@@ -3038,6 +3032,7 @@ PP(pp_require)
     GV *filter_child_proc = 0;
     SV *filter_state = 0;
     SV *filter_sub = 0;
+    SV *hook_sv = 0;
 
     sv = POPs;
     if (SvNIOKp(sv)) {
@@ -3084,7 +3079,7 @@ PP(pp_require)
                if (sver == 0 && (rev > 5 || (rev == 5 && ver >= 100))) {
                    DIE(aTHX_ "Perl v%"UVuf".%"UVuf".%"UVuf" required--"
                        "this is only v%d.%d.%d, stopped"
-                       " (did you mean v%"UVuf".%"UVuf".0?)",
+                       " (did you mean v%"UVuf".%03"UVuf"?)",
                        rev, ver, sver, PERL_REVISION, PERL_VERSION,
                        PERL_SUBVERSION, rev, ver/100);
                }
@@ -3236,6 +3231,7 @@ trylocal: {
                    LEAVE;
 
                    if (tryrsfp) {
+                       hook_sv = dirsv;
                        break;
                    }
 
@@ -3325,7 +3321,9 @@ trylocal: {
 
     /* Assume success here to prevent recursive requirement. */
     (void)hv_store(GvHVn(PL_incgv), name, strlen(name),
-                  newSVpv(CopFILE(&PL_compiling), 0), 0 );
+                  (hook_sv ? SvREFCNT_inc(hook_sv)
+                           : newSVpv(CopFILE(&PL_compiling), 0)),
+                  0 );
 
     ENTER;
     SAVETMPS;