Re: Questions about Tie::Array and perl modules
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 80adc49..c949e78 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2728,7 +2728,9 @@ S_doeval(pTHX_ int gimme, OP** startop)
     AV* comppadlist;
     I32 i;
 
-    PL_in_eval = EVAL_INEVAL;
+    PL_in_eval = ((saveop && saveop->op_type == OP_REQUIRE)
+                 ? (EVAL_INREQUIRE | (PL_in_eval & EVAL_INEVAL))
+                 : EVAL_INEVAL);
 
     PUSHMARK(SP);
 
@@ -2891,6 +2893,7 @@ S_doeval(pTHX_ int gimme, OP** startop)
     CvDEPTH(PL_compcv) = 1;
     SP = PL_stack_base + POPMARK;              /* pop original mark */
     PL_op = saveop;                    /* The caller may need it. */
+    PL_lex_state = LEX_NOTPARSING;     /* $^S needs this. */
 #ifdef USE_THREADS
     MUTEX_LOCK(&PL_eval_mutex);
     PL_eval_owner = 0;
@@ -2959,13 +2962,13 @@ PP(pp_require)
            U8 *s = (U8*)SvPVX(sv);
            U8 *end = (U8*)SvPVX(sv) + SvCUR(sv);
            if (s < end) {
-               rev = utf8_to_uv(s, &len);
+               rev = utf8_to_uv_chk(s, &len, 0);
                s += len;
                if (s < end) {
-                   ver = utf8_to_uv(s, &len);
+                   ver = utf8_to_uv_chk(s, &len, 0);
                    s += len;
                    if (s < end)
-                       sver = utf8_to_uv(s, &len);
+                       sver = utf8_to_uv_chk(s, &len, 0);
                }
            }
            if (PERL_REVISION < rev
@@ -3672,6 +3675,19 @@ S_doparseform(pTHX_ SV *sv)
     SvCOMPILED_on(sv);
 }
 
+/*
+ * The mergesort implementation is by Peter M. Mcilroy <pmcilroy@lucent.com>.
+ *
+ * The original code was written in conjunction with BSD Computer Software
+ * Research Group at University of California, Berkeley.
+ *
+ * See also: "Optimistic Merge Sort" (SODA '92)
+ *      
+ * The integration to Perl is by John P. Linderman <jpl@research.att.com>.
+ *
+ * The code can be distributed under the same terms as Perl itself.
+ *
+ */
 
 #ifdef TESTHARNESS
 #include <sys/types.h>
@@ -3687,20 +3703,6 @@ typedef int  (*SVCOMPARE_t) (pTHXo_ SV*, SV*);
 typedef char * aptr;           /* pointer for arithmetic on sizes */
 typedef SV * gptr;             /* pointers in our lists */
 
-/* 
- * The original author of the mergesort implementation included here
- * is Peter M. McIlroy <pmcilroy@lucent.com> (see: Optimistic Merge Sort
- * (SODA '92)), and the integrator of it to the Perl source code is
- * John Linderman <jpl@research.att.com>.
- *
- * Both Peter and John agree with the inclusion of their code in here
- * and with their code being distributed under the same terms as Perl.
- *
- * This code originally developed in conjunction with the BSD Computer
- * Software Research Group and the University of California at Berkeley.
- *
- */
-
 /* Binary merge internal sort, with a few special mods
 ** for the special perl environment it now finds itself in.
 **