3 * Copyright (c) 1991-1997, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * Now far ahead the Road has gone,
12 * And I must follow, if I can,
13 * Pursuing it with eager feet,
14 * Until it joins some larger way
15 * Where many paths and errands meet.
16 * And whither then? I cannot say.
23 #define WORD_ALIGN sizeof(U16)
26 #define DOCATCH(o) ((CATCH_GET == TRUE) ? docatch(o) : (o))
28 static OP *docatch _((OP *o));
29 static OP *doeval _((int gimme));
30 static OP *dofindlabel _((OP *op, char *label, OP **opstack));
31 static void doparseform _((SV *sv));
32 static I32 dopoptoeval _((I32 startingblock));
33 static I32 dopoptolabel _((char *label));
34 static I32 dopoptoloop _((I32 startingblock));
35 static I32 dopoptosub _((I32 startingblock));
36 static void save_lines _((AV *array, SV *sv));
37 static int sortcv _((const void *, const void *));
38 static int sortcmp _((const void *, const void *));
39 static int sortcmp_locale _((const void *, const void *));
49 cxix = dopoptosub(cxstack_ix);
53 switch (cxstack[cxix].blk_gimme) {
70 register PMOP *pm = (PMOP*)cLOGOP->op_other;
76 t = SvPV(tmpstr, len);
78 /* JMR: Check against the last compiled regexp */
79 if ( ! pm->op_pmregexp || ! pm->op_pmregexp->precomp
80 || strnNE(pm->op_pmregexp->precomp, t, len)
81 || pm->op_pmregexp->precomp[len]) {
82 if (pm->op_pmregexp) {
83 pregfree(pm->op_pmregexp);
84 pm->op_pmregexp = Null(REGEXP*); /* crucial if regcomp aborts */
87 pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */
88 pm->op_pmregexp = pregcomp(t, t + len, pm);
91 if (!pm->op_pmregexp->prelen && curpm)
93 else if (strEQ("\\s+", pm->op_pmregexp->precomp))
94 pm->op_pmflags |= PMf_WHITE;
96 if (pm->op_pmflags & PMf_KEEP) {
97 pm->op_pmflags &= ~PMf_RUNTIME; /* no point compiling again */
99 cLOGOP->op_first->op_next = op->op_next;
107 register PMOP *pm = (PMOP*) cLOGOP->op_other;
108 register CONTEXT *cx = &cxstack[cxstack_ix];
109 register SV *dstr = cx->sb_dstr;
110 register char *s = cx->sb_s;
111 register char *m = cx->sb_m;
112 char *orig = cx->sb_orig;
113 register REGEXP *rx = cx->sb_rx;
115 if (cx->sb_iters++) {
116 if (cx->sb_iters > cx->sb_maxiters)
117 DIE("Substitution loop");
119 if (!cx->sb_rxtainted)
120 cx->sb_rxtainted = SvTAINTED(TOPs);
121 sv_catsv(dstr, POPs);
123 Safefree(rx->subbase);
124 rx->subbase = cx->sb_subbase;
127 if (cx->sb_once || !pregexec(rx, s, cx->sb_strend, orig,
128 s == m, Nullsv, cx->sb_safebase))
130 SV *targ = cx->sb_targ;
131 sv_catpvn(dstr, s, cx->sb_strend - s);
133 TAINT_IF(cx->sb_rxtainted || rx->exec_tainted);
135 (void)SvOOK_off(targ);
136 Safefree(SvPVX(targ));
137 SvPVX(targ) = SvPVX(dstr);
138 SvCUR_set(targ, SvCUR(dstr));
139 SvLEN_set(targ, SvLEN(dstr));
143 (void)SvPOK_only(targ);
146 PUSHs(sv_2mortal(newSViv((I32)cx->sb_iters - 1)));
147 LEAVE_SCOPE(cx->sb_oldsave);
149 RETURNOP(pm->op_next);
152 if (rx->subbase && rx->subbase != orig) {
155 cx->sb_orig = orig = rx->subbase;
157 cx->sb_strend = s + (cx->sb_strend - m);
159 cx->sb_m = m = rx->startp[0];
160 sv_catpvn(dstr, s, m-s);
161 cx->sb_s = rx->endp[0];
162 cx->sb_subbase = rx->subbase;
163 cx->sb_rxtainted |= rx->exec_tainted;
165 rx->subbase = Nullch; /* so recursion works */
166 RETURNOP(pm->op_pmreplstart);
171 dSP; dMARK; dORIGMARK;
172 register SV *form = *++MARK;
184 bool chopspace = (strchr(chopset, ' ') != Nullch);
191 if (!SvMAGICAL(form) || !SvCOMPILED(form)) {
192 SvREADONLY_off(form);
196 SvPV_force(formtarget, len);
197 t = SvGROW(formtarget, len + SvCUR(form) + 1); /* XXX SvCUR bad */
200 /* need to jump to the next word */
201 s = f + len + WORD_ALIGN - SvCUR(form) % WORD_ALIGN;
210 case FF_LITERAL: arg = fpc[1]; name = "LITERAL"; break;
211 case FF_BLANK: arg = fpc[1]; name = "BLANK"; break;
212 case FF_SKIP: arg = fpc[1]; name = "SKIP"; break;
213 case FF_FETCH: arg = fpc[1]; name = "FETCH"; break;
214 case FF_DECIMAL: arg = fpc[1]; name = "DECIMAL"; break;
216 case FF_CHECKNL: name = "CHECKNL"; break;
217 case FF_CHECKCHOP: name = "CHECKCHOP"; break;
218 case FF_SPACE: name = "SPACE"; break;
219 case FF_HALFSPACE: name = "HALFSPACE"; break;
220 case FF_ITEM: name = "ITEM"; break;
221 case FF_CHOP: name = "CHOP"; break;
222 case FF_LINEGLOB: name = "LINEGLOB"; break;
223 case FF_NEWLINE: name = "NEWLINE"; break;
224 case FF_MORE: name = "MORE"; break;
225 case FF_LINEMARK: name = "LINEMARK"; break;
226 case FF_END: name = "END"; break;
229 PerlIO_printf(PerlIO_stderr(), "%-16s%ld\n", name, (long) arg);
231 PerlIO_printf(PerlIO_stderr(), "%-16s\n", name);
260 warn("Not enough format arguments");
265 item = s = SvPV(sv, len);
267 if (itemsize > fieldsize)
268 itemsize = fieldsize;
269 send = chophere = s + itemsize;
281 item = s = SvPV(sv, len);
283 if (itemsize <= fieldsize) {
284 send = chophere = s + itemsize;
295 itemsize = fieldsize;
296 send = chophere = s + itemsize;
297 while (s < send || (s == send && isSPACE(*s))) {
307 if (strchr(chopset, *s))
312 itemsize = chophere - item;
317 arg = fieldsize - itemsize;
326 arg = fieldsize - itemsize;
340 int ch = *t++ = *s++;
344 if ( !((*t++ = *s++) & ~31) )
354 while (*s && isSPACE(*s))
361 item = s = SvPV(sv, len);
374 SvCUR_set(formtarget, t - SvPVX(formtarget));
375 sv_catpvn(formtarget, item, itemsize);
376 SvGROW(formtarget, SvCUR(formtarget) + SvCUR(form) + 1);
377 t = SvPVX(formtarget) + SvCUR(formtarget);
382 /* If the field is marked with ^ and the value is undefined,
385 if ((arg & 512) && !SvOK(sv)) {
393 /* Formats aren't yet marked for locales, so assume "yes". */
396 sprintf(t, "%#*.*f", (int) fieldsize, (int) arg & 255, value);
398 sprintf(t, "%*.0f", (int) fieldsize, value);
405 while (t-- > linemark && *t == ' ') ;
413 if (arg) { /* repeat until fields exhausted? */
415 SvCUR_set(formtarget, t - SvPVX(formtarget));
416 lines += FmLINES(formtarget);
419 if (strnEQ(linemark, linemark - arg, arg))
420 DIE("Runaway format");
422 FmLINES(formtarget) = lines;
424 RETURNOP(cLISTOP->op_first);
435 arg = fieldsize - itemsize;
442 if (strnEQ(s," ",3)) {
443 while (s > SvPVX(formtarget) && isSPACE(s[-1]))
454 SvCUR_set(formtarget, t - SvPVX(formtarget));
455 FmLINES(formtarget) += lines;
467 if (stack_base + *markstack_ptr == sp) {
469 if (GIMME_V == G_SCALAR)
471 RETURNOP(op->op_next->op_next);
473 stack_sp = stack_base + *markstack_ptr + 1;
474 pp_pushmark(); /* push dst */
475 pp_pushmark(); /* push src */
476 ENTER; /* enter outer scope */
479 SAVESPTR(GvSV(defgv));
481 ENTER; /* enter inner scope */
484 src = stack_base[*markstack_ptr];
489 if (op->op_type == OP_MAPSTART)
490 pp_pushmark(); /* push top */
491 return ((LOGOP*)op->op_next)->op_other;
496 DIE("panic: mapstart"); /* uses grepstart */
502 I32 diff = (sp - stack_base) - *markstack_ptr;
510 if (diff > markstack_ptr[-1] - markstack_ptr[-2]) {
511 shift = diff - (markstack_ptr[-1] - markstack_ptr[-2]);
512 count = (sp - stack_base) - markstack_ptr[-1] + 2;
517 markstack_ptr[-1] += shift;
518 *markstack_ptr += shift;
522 dst = stack_base + (markstack_ptr[-2] += diff) - 1;
525 *dst-- = SvTEMP(TOPs) ? POPs : sv_mortalcopy(POPs);
527 LEAVE; /* exit inner scope */
530 if (markstack_ptr[-1] > *markstack_ptr) {
534 (void)POPMARK; /* pop top */
535 LEAVE; /* exit outer scope */
536 (void)POPMARK; /* pop src */
537 items = --*markstack_ptr - markstack_ptr[-1];
538 (void)POPMARK; /* pop dst */
539 SP = stack_base + POPMARK; /* pop original mark */
540 if (gimme == G_SCALAR) {
544 else if (gimme == G_ARRAY)
551 ENTER; /* enter inner scope */
554 src = stack_base[markstack_ptr[-1]];
558 RETURNOP(cLOGOP->op_other);
565 dSP; dMARK; dORIGMARK;
567 SV **myorigmark = ORIGMARK;
573 OP* nextop = op->op_next;
575 if (gimme != G_ARRAY) {
580 if (op->op_flags & OPf_STACKED) {
582 if (op->op_flags & OPf_SPECIAL) {
583 OP *kid = cLISTOP->op_first->op_sibling; /* pass pushmark */
584 kid = kUNOP->op_first; /* pass rv2gv */
585 kid = kUNOP->op_first; /* pass leave */
586 sortcop = kid->op_next;
587 stash = curcop->cop_stash;
590 cv = sv_2cv(*++MARK, &stash, &gv, 0);
591 if (!(cv && CvROOT(cv))) {
593 SV *tmpstr = sv_newmortal();
594 gv_efullname3(tmpstr, gv, Nullch);
595 if (cv && CvXSUB(cv))
596 DIE("Xsub \"%s\" called in sort", SvPVX(tmpstr));
597 DIE("Undefined sort subroutine \"%s\" called",
602 DIE("Xsub called in sort");
603 DIE("Undefined subroutine in sort");
605 DIE("Not a CODE reference in sort");
607 sortcop = CvSTART(cv);
608 SAVESPTR(CvROOT(cv)->op_ppaddr);
609 CvROOT(cv)->op_ppaddr = ppaddr[OP_NULL];
612 curpad = AvARRAY((AV*)AvARRAY(CvPADLIST(cv))[1]);
617 stash = curcop->cop_stash;
621 while (MARK < SP) { /* This may or may not shift down one here. */
623 if (*up = *++MARK) { /* Weed out nulls. */
625 if (!sortcop && !SvPOK(*up))
626 (void)sv_2pv(*up, &na);
630 max = --up - myorigmark;
636 bool oldcatch = CATCH_GET;
644 AvREAL_off(sortstack);
645 av_extend(sortstack, 32);
648 SWITCHSTACK(curstack, sortstack);
649 if (sortstash != stash) {
650 firstgv = gv_fetchpv("a", TRUE, SVt_PV);
651 secondgv = gv_fetchpv("b", TRUE, SVt_PV);
655 SAVESPTR(GvSV(firstgv));
656 SAVESPTR(GvSV(secondgv));
657 PUSHBLOCK(cx, CXt_NULL, stack_base);
658 sortcxix = cxstack_ix;
660 qsort((char*)(myorigmark+1), max, sizeof(SV*), sortcv);
663 SWITCHSTACK(sortstack, oldstack);
670 MEXTEND(SP, 20); /* Can't afford stack realloc on signal. */
671 qsort((char*)(ORIGMARK+1), max, sizeof(SV*),
672 (op->op_private & OPpLOCALE) ? sortcmp_locale : sortcmp);
675 stack_sp = ORIGMARK + max;
683 if (GIMME == G_ARRAY)
684 return cCONDOP->op_true;
685 return SvTRUEx(PAD_SV(op->op_targ)) ? cCONDOP->op_false : cCONDOP->op_true;
692 if (GIMME == G_ARRAY) {
693 RETURNOP(((CONDOP*)cUNOP->op_first)->op_false);
697 SV *targ = PAD_SV(op->op_targ);
699 if ((op->op_private & OPpFLIP_LINENUM)
700 ? last_in_gv && SvIV(sv) == IoLINES(GvIOp(last_in_gv))
702 sv_setiv(PAD_SV(cUNOP->op_first->op_targ), 1);
703 if (op->op_flags & OPf_SPECIAL) {
710 RETURNOP(((CONDOP*)cUNOP->op_first)->op_false);
723 if (GIMME == G_ARRAY) {
729 if (SvNIOKp(left) || !SvPOKp(left) ||
730 (looks_like_number(left) && *SvPVX(left) != '0') )
735 EXTEND_MORTAL(max - i + 1);
736 EXTEND(SP, max - i + 1);
739 sv = sv_2mortal(newSViv(i++));
744 SV *final = sv_mortalcopy(right);
746 char *tmps = SvPV(final, len);
748 sv = sv_mortalcopy(left);
749 while (!SvNIOKp(sv) && SvCUR(sv) <= len &&
750 strNE(SvPVX(sv),tmps) ) {
752 sv = sv_2mortal(newSVsv(sv));
755 if (strEQ(SvPVX(sv),tmps))
761 SV *targ = PAD_SV(cUNOP->op_first->op_targ);
763 if ((op->op_private & OPpFLIP_LINENUM)
764 ? last_in_gv && SvIV(sv) == IoLINES(GvIOp(last_in_gv))
766 sv_setiv(PAD_SV(((UNOP*)cUNOP->op_first)->op_first->op_targ), 0);
767 sv_catpv(targ, "E0");
782 register CONTEXT *cx;
784 for (i = cxstack_ix; i >= 0; i--) {
786 switch (cx->cx_type) {
789 warn("Exiting substitution via %s", op_name[op->op_type]);
793 warn("Exiting subroutine via %s", op_name[op->op_type]);
797 warn("Exiting eval via %s", op_name[op->op_type]);
801 warn("Exiting pseudo-block via %s", op_name[op->op_type]);
804 if (!cx->blk_loop.label ||
805 strNE(label, cx->blk_loop.label) ) {
806 DEBUG_l(deb("(Skipping label #%ld %s)\n",
807 (long)i, cx->blk_loop.label));
810 DEBUG_l( deb("(Found label #%ld %s)\n", (long)i, label));
820 I32 gimme = block_gimme();
821 return (gimme == G_VOID) ? G_SCALAR : gimme;
829 cxix = dopoptosub(cxstack_ix);
833 switch (cxstack[cxix].blk_gimme) {
841 croak("panic: bad gimme: %d\n", cxstack[cxix].blk_gimme);
846 dopoptosub(startingblock)
850 register CONTEXT *cx;
851 for (i = startingblock; i >= 0; i--) {
853 switch (cx->cx_type) {
858 DEBUG_l( deb("(Found sub #%ld)\n", (long)i));
866 dopoptoeval(startingblock)
870 register CONTEXT *cx;
871 for (i = startingblock; i >= 0; i--) {
873 switch (cx->cx_type) {
877 DEBUG_l( deb("(Found eval #%ld)\n", (long)i));
885 dopoptoloop(startingblock)
889 register CONTEXT *cx;
890 for (i = startingblock; i >= 0; i--) {
892 switch (cx->cx_type) {
895 warn("Exiting substitution via %s", op_name[op->op_type]);
899 warn("Exiting subroutine via %s", op_name[op->op_type]);
903 warn("Exiting eval via %s", op_name[op->op_type]);
907 warn("Exiting pseudo-block via %s", op_name[op->op_type]);
910 DEBUG_l( deb("(Found loop #%ld)\n", (long)i));
921 register CONTEXT *cx;
925 while (cxstack_ix > cxix) {
926 cx = &cxstack[cxstack_ix--];
927 DEBUG_l(PerlIO_printf(Perl_debug_log, "Unwinding block %ld, type %s\n", (long) cxstack_ix+1,
928 block_type[cx->cx_type]));
929 /* Note: we don't need to restore the base context info till the end. */
930 switch (cx->cx_type) {
953 register CONTEXT *cx;
959 STRLEN klen = strlen(message);
961 svp = hv_fetch(GvHV(errgv), message, klen, TRUE);
964 static char prefix[] = "\t(in cleanup) ";
965 sv_upgrade(*svp, SVt_IV);
966 (void)SvIOK_only(*svp);
967 SvGROW(GvSV(errgv), SvCUR(GvSV(errgv))+sizeof(prefix)+klen);
968 sv_catpvn(GvSV(errgv), prefix, sizeof(prefix)-1);
969 sv_catpvn(GvSV(errgv), message, klen);
975 sv_setpv(GvSV(errgv), message);
977 cxix = dopoptoeval(cxstack_ix);
981 if (cxix < cxstack_ix)
985 if (cx->cx_type != CXt_EVAL) {
986 PerlIO_printf(PerlIO_stderr(), "panic: die %s", message);
991 if (gimme == G_SCALAR)
992 *++newsp = &sv_undef;
997 if (optype == OP_REQUIRE)
998 DIE("%s", SvPVx(GvSV(errgv), na));
1002 PerlIO_printf(PerlIO_stderr(), "%s",message);
1003 PerlIO_flush(PerlIO_stderr());
1012 if (SvTRUE(left) != SvTRUE(right))
1024 RETURNOP(cLOGOP->op_other);
1033 RETURNOP(cLOGOP->op_other);
1040 SV** mark = (stack_base + *markstack_ptr + 1);
1042 while (mark < sp) { /* emulate old interface */
1047 return pp_entersub();
1054 register I32 cxix = dopoptosub(cxstack_ix);
1055 register CONTEXT *cx;
1066 if (GIMME != G_ARRAY)
1070 if (DBsub && cxix >= 0 &&
1071 cxstack[cxix].blk_sub.cv == GvCV(DBsub))
1075 cxix = dopoptosub(cxix - 1);
1077 cx = &cxstack[cxix];
1078 if (cxstack[cxix].cx_type == CXt_SUB) {
1079 dbcxix = dopoptosub(cxix - 1);
1080 /* We expect that cxstack[dbcxix] is CXt_SUB, anyway, the
1081 field below is defined for any cx. */
1082 if (DBsub && dbcxix >= 0 && cxstack[dbcxix].blk_sub.cv == GvCV(DBsub))
1083 cx = &cxstack[dbcxix];
1086 if (GIMME != G_ARRAY) {
1089 sv_setpv(TARG, HvNAME(cx->blk_oldcop->cop_stash));
1094 PUSHs(sv_2mortal(newSVpv(HvNAME(cx->blk_oldcop->cop_stash), 0)));
1095 PUSHs(sv_2mortal(newSVpv(SvPVX(GvSV(cx->blk_oldcop->cop_filegv)), 0)));
1096 PUSHs(sv_2mortal(newSViv((I32)cx->blk_oldcop->cop_line)));
1099 if (cx->cx_type == CXt_SUB) { /* So is cxstack[dbcxix]. */
1101 gv_efullname3(sv, CvGV(cxstack[cxix].blk_sub.cv), Nullch);
1102 PUSHs(sv_2mortal(sv));
1103 PUSHs(sv_2mortal(newSViv((I32)cx->blk_sub.hasargs)));
1106 PUSHs(sv_2mortal(newSVpv("(eval)",0)));
1107 PUSHs(sv_2mortal(newSViv(0)));
1109 gimme = (I32)cx->blk_gimme;
1110 if (gimme == G_VOID)
1113 PUSHs(sv_2mortal(newSViv(gimme & G_ARRAY)));
1114 if (cx->cx_type == CXt_EVAL) {
1115 if (cx->blk_eval.old_op_type == OP_ENTEREVAL) {
1116 PUSHs(cx->blk_eval.cur_text);
1119 else if (cx->blk_eval.old_name) { /* Try blocks have old_name == 0. */
1120 /* Require, put the name. */
1121 PUSHs(sv_2mortal(newSVpv(cx->blk_eval.old_name, 0)));
1125 else if (cx->cx_type == CXt_SUB &&
1126 cx->blk_sub.hasargs &&
1127 curcop->cop_stash == debstash)
1129 AV *ary = cx->blk_sub.argarray;
1130 int off = AvARRAY(ary) - AvALLOC(ary);
1134 dbargs = GvAV(gv_AVadd(tmpgv = gv_fetchpv("DB::args", TRUE,
1137 AvREAL_off(dbargs); /* XXX Should be REIFY */
1140 if (AvMAX(dbargs) < AvFILL(ary) + off)
1141 av_extend(dbargs, AvFILL(ary) + off);
1142 Copy(AvALLOC(ary), AvARRAY(dbargs), AvFILL(ary) + 1 + off, SV*);
1143 AvFILL(dbargs) = AvFILL(ary) + off;
1153 SV * const *str1 = (SV * const *)a;
1154 SV * const *str2 = (SV * const *)b;
1155 I32 oldsaveix = savestack_ix;
1156 I32 oldscopeix = scopestack_ix;
1158 GvSV(firstgv) = *str1;
1159 GvSV(secondgv) = *str2;
1160 stack_sp = stack_base;
1163 if (stack_sp != stack_base + 1)
1164 croak("Sort subroutine didn't return single value");
1165 if (!SvNIOKp(*stack_sp))
1166 croak("Sort subroutine didn't return a numeric value");
1167 result = SvIV(*stack_sp);
1168 while (scopestack_ix > oldscopeix) {
1171 leave_scope(oldsaveix);
1180 return sv_cmp(*(SV * const *)a, *(SV * const *)b);
1184 sortcmp_locale(a, b)
1188 return sv_cmp_locale(*(SV * const *)a, *(SV * const *)b);
1200 sv_reset(tmps, curcop->cop_stash);
1213 TAINT_NOT; /* Each statement is presumed innocent */
1214 stack_sp = stack_base + cxstack[cxstack_ix].blk_oldsp;
1217 if (op->op_private || SvIV(DBsingle) || SvIV(DBsignal) || SvIV(DBtrace))
1221 register CONTEXT *cx;
1222 I32 gimme = G_ARRAY;
1229 DIE("No DB::DB routine defined");
1231 if (CvDEPTH(cv) >= 1 && !(debug & (1<<30))) /* don't do recursive DB::DB call */
1243 push_return(op->op_next);
1244 PUSHBLOCK(cx, CXt_SUB, sp);
1247 (void)SvREFCNT_inc(cv);
1249 curpad = AvARRAY((AV*)*av_fetch(CvPADLIST(cv),1,FALSE));
1250 RETURNOP(CvSTART(cv));
1264 register CONTEXT *cx;
1265 I32 gimme = GIMME_V;
1272 svp = &curpad[op->op_targ]; /* "my" variable */
1274 svp = &GvSV((GV*)POPs); /* symbol table variable */
1280 PUSHBLOCK(cx, CXt_LOOP, SP);
1281 PUSHLOOP(cx, svp, MARK);
1282 if (op->op_flags & OPf_STACKED)
1283 cx->blk_loop.iterary = (AV*)SvREFCNT_inc(POPs);
1285 cx->blk_loop.iterary = curstack;
1286 AvFILL(curstack) = sp - stack_base;
1287 cx->blk_loop.iterix = MARK - stack_base;
1296 register CONTEXT *cx;
1297 I32 gimme = GIMME_V;
1303 PUSHBLOCK(cx, CXt_LOOP, SP);
1304 PUSHLOOP(cx, 0, SP);
1312 register CONTEXT *cx;
1313 struct block_loop cxloop;
1321 POPLOOP1(cx); /* Delay POPLOOP2 until stack values are safe */
1323 if (gimme == G_VOID)
1325 else if (gimme == G_SCALAR) {
1327 *++newsp = sv_mortalcopy(*SP);
1329 *++newsp = &sv_undef;
1333 *++newsp = sv_mortalcopy(*++mark);
1338 POPLOOP2(); /* Stack values are safe: release loop vars ... */
1339 curpm = newpm; /* ... and pop $1 et al */
1351 register CONTEXT *cx;
1352 struct block_sub cxsub;
1353 bool popsub2 = FALSE;
1359 if (curstack == sortstack) {
1360 if (cxstack_ix == sortcxix || dopoptosub(cxstack_ix) < sortcxix) {
1361 if (cxstack_ix > sortcxix)
1363 AvARRAY(curstack)[1] = *SP;
1364 stack_sp = stack_base + 1;
1369 cxix = dopoptosub(cxstack_ix);
1371 DIE("Can't return outside a subroutine");
1372 if (cxix < cxstack_ix)
1376 switch (cx->cx_type) {
1378 POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
1383 if (optype == OP_REQUIRE &&
1384 (MARK == SP || (gimme == G_SCALAR && !SvTRUE(*SP))) )
1386 /* Unassume the success we assumed earlier. */
1387 char *name = cx->blk_eval.old_name;
1388 (void)hv_delete(GvHVn(incgv), name, strlen(name), G_DISCARD);
1389 DIE("%s did not return a true value", name);
1393 DIE("panic: return");
1396 if (gimme == G_SCALAR) {
1398 *++newsp = (popsub2 && SvTEMP(*SP))
1399 ? *SP : sv_mortalcopy(*SP);
1401 *++newsp = &sv_undef;
1403 else if (gimme == G_ARRAY) {
1404 while (++MARK <= SP)
1405 *++newsp = (popsub2 && SvTEMP(*MARK))
1406 ? *MARK : sv_mortalcopy(*MARK);
1410 /* Stack values are safe: */
1412 POPSUB2(); /* release CV and @_ ... */
1414 curpm = newpm; /* ... and pop $1 et al */
1417 return pop_return();
1424 register CONTEXT *cx;
1425 struct block_loop cxloop;
1426 struct block_sub cxsub;
1433 SV **mark = stack_base + cxstack[cxstack_ix].blk_oldsp;
1435 if (op->op_flags & OPf_SPECIAL) {
1436 cxix = dopoptoloop(cxstack_ix);
1438 DIE("Can't \"last\" outside a block");
1441 cxix = dopoptolabel(cPVOP->op_pv);
1443 DIE("Label not found for \"last %s\"", cPVOP->op_pv);
1445 if (cxix < cxstack_ix)
1449 switch (cx->cx_type) {
1451 POPLOOP1(cx); /* Delay POPLOOP2 until stack values are safe */
1453 nextop = cxloop.last_op->op_next;
1456 POPSUB1(cx); /* Delay POPSUB2 until stack values are safe */
1458 nextop = pop_return();
1462 nextop = pop_return();
1468 if (gimme == G_SCALAR) {
1470 *++newsp = ((pop2 == CXt_SUB) && SvTEMP(*SP))
1471 ? *SP : sv_mortalcopy(*SP);
1473 *++newsp = &sv_undef;
1475 else if (gimme == G_ARRAY) {
1476 while (++MARK <= SP)
1477 *++newsp = ((pop2 == CXt_SUB) && SvTEMP(*MARK))
1478 ? *MARK : sv_mortalcopy(*MARK);
1483 /* Stack values are safe: */
1486 POPLOOP2(); /* release loop vars ... */
1490 POPSUB2(); /* release CV and @_ ... */
1493 curpm = newpm; /* ... and pop $1 et al */
1502 register CONTEXT *cx;
1505 if (op->op_flags & OPf_SPECIAL) {
1506 cxix = dopoptoloop(cxstack_ix);
1508 DIE("Can't \"next\" outside a block");
1511 cxix = dopoptolabel(cPVOP->op_pv);
1513 DIE("Label not found for \"next %s\"", cPVOP->op_pv);
1515 if (cxix < cxstack_ix)
1519 oldsave = scopestack[scopestack_ix - 1];
1520 LEAVE_SCOPE(oldsave);
1521 return cx->blk_loop.next_op;
1527 register CONTEXT *cx;
1530 if (op->op_flags & OPf_SPECIAL) {
1531 cxix = dopoptoloop(cxstack_ix);
1533 DIE("Can't \"redo\" outside a block");
1536 cxix = dopoptolabel(cPVOP->op_pv);
1538 DIE("Label not found for \"redo %s\"", cPVOP->op_pv);
1540 if (cxix < cxstack_ix)
1544 oldsave = scopestack[scopestack_ix - 1];
1545 LEAVE_SCOPE(oldsave);
1546 return cx->blk_loop.redo_op;
1549 static OP* lastgotoprobe;
1552 dofindlabel(op,label,opstack)
1560 if (op->op_type == OP_LEAVE ||
1561 op->op_type == OP_SCOPE ||
1562 op->op_type == OP_LEAVELOOP ||
1563 op->op_type == OP_LEAVETRY)
1564 *ops++ = cUNOP->op_first;
1566 if (op->op_flags & OPf_KIDS) {
1567 /* First try all the kids at this level, since that's likeliest. */
1568 for (kid = cUNOP->op_first; kid; kid = kid->op_sibling) {
1569 if ((kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE) &&
1570 kCOP->cop_label && strEQ(kCOP->cop_label, label))
1573 for (kid = cUNOP->op_first; kid; kid = kid->op_sibling) {
1574 if (kid == lastgotoprobe)
1576 if (kid->op_type == OP_NEXTSTATE || kid->op_type == OP_DBSTATE) {
1577 if (ops > opstack &&
1578 (ops[-1]->op_type == OP_NEXTSTATE ||
1579 ops[-1]->op_type == OP_DBSTATE))
1584 if (op = dofindlabel(kid,label,ops))
1594 return pp_goto(ARGS);
1603 register CONTEXT *cx;
1606 int do_dump = (op->op_type == OP_DUMP);
1609 if (op->op_flags & OPf_STACKED) {
1612 /* This egregious kludge implements goto &subroutine */
1613 if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVCV) {
1615 register CONTEXT *cx;
1616 CV* cv = (CV*)SvRV(sv);
1621 if (!CvROOT(cv) && !CvXSUB(cv)) {
1623 SV *tmpstr = sv_newmortal();
1624 gv_efullname3(tmpstr, CvGV(cv), Nullch);
1625 DIE("Goto undefined subroutine &%s",SvPVX(tmpstr));
1627 DIE("Goto undefined subroutine");
1630 /* First do some returnish stuff. */
1631 cxix = dopoptosub(cxstack_ix);
1633 DIE("Can't goto subroutine outside a subroutine");
1634 if (cxix < cxstack_ix)
1638 if (cx->blk_sub.hasargs) { /* put @_ back onto stack */
1639 AV* av = cx->blk_sub.argarray;
1641 items = AvFILL(av) + 1;
1643 EXTEND(stack_sp, items); /* @_ could have been extended. */
1644 Copy(AvARRAY(av), stack_sp, items, SV*);
1646 SvREFCNT_dec(GvAV(defgv));
1647 GvAV(defgv) = cx->blk_sub.savearray;
1651 if (!(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth))
1652 SvREFCNT_dec(cx->blk_sub.cv);
1653 oldsave = scopestack[scopestack_ix - 1];
1654 LEAVE_SCOPE(oldsave);
1656 /* Now do some callish stuff. */
1659 if (CvOLDSTYLE(cv)) {
1660 I32 (*fp3)_((int,int,int));
1665 fp3 = (I32(*)_((int,int,int)))CvXSUB(cv);
1666 items = (*fp3)(CvXSUBANY(cv).any_i32,
1667 mark - stack_base + 1,
1669 sp = stack_base + items;
1672 stack_sp--; /* There is no cv arg. */
1673 (void)(*CvXSUB(cv))(cv);
1676 return pop_return();
1679 AV* padlist = CvPADLIST(cv);
1680 SV** svp = AvARRAY(padlist);
1681 cx->blk_sub.cv = cv;
1682 cx->blk_sub.olddepth = CvDEPTH(cv);
1684 if (CvDEPTH(cv) < 2)
1685 (void)SvREFCNT_inc(cv);
1686 else { /* save temporaries on recursion? */
1687 if (CvDEPTH(cv) == 100 && dowarn)
1688 sub_crush_depth(cv);
1689 if (CvDEPTH(cv) > AvFILL(padlist)) {
1690 AV *newpad = newAV();
1691 SV **oldpad = AvARRAY(svp[CvDEPTH(cv)-1]);
1692 I32 ix = AvFILL((AV*)svp[1]);
1693 svp = AvARRAY(svp[0]);
1694 for ( ;ix > 0; ix--) {
1695 if (svp[ix] != &sv_undef) {
1696 char *name = SvPVX(svp[ix]);
1697 if ((SvFLAGS(svp[ix]) & SVf_FAKE)
1700 /* outer lexical or anon code */
1701 av_store(newpad, ix,
1702 SvREFCNT_inc(oldpad[ix]) );
1704 else { /* our own lexical */
1706 av_store(newpad, ix, sv = (SV*)newAV());
1707 else if (*name == '%')
1708 av_store(newpad, ix, sv = (SV*)newHV());
1710 av_store(newpad, ix, sv = NEWSV(0,0));
1715 av_store(newpad, ix, sv = NEWSV(0,0));
1719 if (cx->blk_sub.hasargs) {
1722 av_store(newpad, 0, (SV*)av);
1723 AvFLAGS(av) = AVf_REIFY;
1725 av_store(padlist, CvDEPTH(cv), (SV*)newpad);
1726 AvFILL(padlist) = CvDEPTH(cv);
1727 svp = AvARRAY(padlist);
1731 curpad = AvARRAY((AV*)svp[CvDEPTH(cv)]);
1732 if (cx->blk_sub.hasargs) {
1733 AV* av = (AV*)curpad[0];
1736 cx->blk_sub.savearray = GvAV(defgv);
1737 cx->blk_sub.argarray = av;
1738 GvAV(defgv) = (AV*)SvREFCNT_inc(av);
1741 if (items >= AvMAX(av) + 1) {
1743 if (AvARRAY(av) != ary) {
1744 AvMAX(av) += AvARRAY(av) - AvALLOC(av);
1745 SvPVX(av) = (char*)ary;
1747 if (items >= AvMAX(av) + 1) {
1748 AvMAX(av) = items - 1;
1749 Renew(ary,items+1,SV*);
1751 SvPVX(av) = (char*)ary;
1754 Copy(mark,AvARRAY(av),items,SV*);
1755 AvFILL(av) = items - 1;
1763 if (perldb && curstash != debstash) {
1765 * We do not care about using sv to call CV;
1766 * it's for informational purposes only.
1768 SV *sv = GvSV(DBsub);
1770 gv_efullname3(sv, CvGV(cv), Nullch);
1772 RETURNOP(CvSTART(cv));
1776 label = SvPV(sv,na);
1778 else if (op->op_flags & OPf_SPECIAL) {
1780 DIE("goto must have label");
1783 label = cPVOP->op_pv;
1785 if (label && *label) {
1792 for (ix = cxstack_ix; ix >= 0; ix--) {
1794 switch (cx->cx_type) {
1796 gotoprobe = CvROOT(cx->blk_sub.cv);
1799 gotoprobe = eval_root; /* XXX not good for nested eval */
1802 gotoprobe = cx->blk_oldcop->op_sibling;
1808 gotoprobe = cx->blk_oldcop->op_sibling;
1810 gotoprobe = main_root;
1813 DIE("Can't \"goto\" outside a block");
1817 gotoprobe = main_root;
1820 retop = dofindlabel(gotoprobe, label, enterops);
1823 lastgotoprobe = gotoprobe;
1826 DIE("Can't find label %s", label);
1828 /* pop unwanted frames */
1830 if (ix < cxstack_ix) {
1837 oldsave = scopestack[scopestack_ix];
1838 LEAVE_SCOPE(oldsave);
1841 /* push wanted frames */
1843 if (*enterops && enterops[1]) {
1845 for (ix = 1; enterops[ix]; ix++) {
1855 if (!retop) retop = main_start;
1862 restartop = 0; /* hmm, must be GNU unexec().. */
1866 if (curstack == signalstack) {
1884 if (anum == 1 && VMSISH_EXIT)
1897 double value = SvNVx(GvSV(cCOP->cop_gv));
1898 register I32 match = I_32(value);
1901 if (((double)match) > value)
1902 --match; /* was fractional--truncate other way */
1904 match -= cCOP->uop.scop.scop_offset;
1907 else if (match > cCOP->uop.scop.scop_max)
1908 match = cCOP->uop.scop.scop_max;
1909 op = cCOP->uop.scop.scop_next[match];
1919 op = op->op_next; /* can't assume anything */
1921 match = *(SvPVx(GvSV(cCOP->cop_gv), na)) & 255;
1922 match -= cCOP->uop.scop.scop_offset;
1925 else if (match > cCOP->uop.scop.scop_max)
1926 match = cCOP->uop.scop.scop_max;
1927 op = cCOP->uop.scop.scop_next[match];
1936 save_lines(array, sv)
1940 register char *s = SvPVX(sv);
1941 register char *send = SvPVX(sv) + SvCUR(sv);
1943 register I32 line = 1;
1945 while (s && s < send) {
1946 SV *tmpstr = NEWSV(85,0);
1948 sv_upgrade(tmpstr, SVt_PVMG);
1949 t = strchr(s, '\n');
1955 sv_setpvn(tmpstr, s, t - s);
1956 av_store(array, line++, tmpstr);
1966 int oldrunlevel = runlevel;
1972 assert(CATCH_GET == TRUE);
1973 DEBUG_l(deb("(Setting up local jumplevel, runlevel = %d)\n", runlevel+1));
1977 default: /* topmost level handles it */
1979 runlevel = oldrunlevel;
1985 PerlIO_printf(PerlIO_stderr(), "panic: restartop\n");
1996 runlevel = oldrunlevel;
2015 /* set up a scratch pad */
2020 SAVESPTR(comppad_name);
2021 SAVEI32(comppad_name_fill);
2022 SAVEI32(min_intro_pending);
2023 SAVEI32(max_intro_pending);
2027 compcv = (CV*)NEWSV(1104,0);
2028 sv_upgrade((SV *)compcv, SVt_PVCV);
2029 CvUNIQUE_on(compcv);
2032 comppad_name = newAV();
2033 comppad_name_fill = 0;
2034 min_intro_pending = 0;
2035 av_push(comppad, Nullsv);
2036 curpad = AvARRAY(comppad);
2039 comppadlist = newAV();
2040 AvREAL_off(comppadlist);
2041 av_store(comppadlist, 0, (SV*)comppad_name);
2042 av_store(comppadlist, 1, (SV*)comppad);
2043 CvPADLIST(compcv) = comppadlist;
2045 if (saveop->op_type != OP_REQUIRE)
2046 CvOUTSIDE(compcv) = (CV*)SvREFCNT_inc(caller);
2050 /* make sure we compile in the right package */
2052 newstash = curcop->cop_stash;
2053 if (curstash != newstash) {
2055 curstash = newstash;
2059 SAVEFREESV(beginav);
2061 /* try to compile it */
2065 curcop = &compiling;
2066 curcop->cop_arybase = 0;
2068 rs = newSVpv("\n", 1);
2069 if (saveop->op_flags & OPf_SPECIAL)
2072 sv_setpv(GvSV(errgv),"");
2073 if (yyparse() || error_count || !eval_root) {
2084 SP = stack_base + POPMARK; /* pop original mark */
2090 if (optype == OP_REQUIRE)
2091 DIE("%s", SvPVx(GvSV(errgv), na));
2093 rs = SvREFCNT_inc(nrs);
2097 rs = SvREFCNT_inc(nrs);
2098 compiling.cop_line = 0;
2099 SAVEFREEOP(eval_root);
2101 scalarvoid(eval_root);
2102 else if (gimme & G_ARRAY)
2107 DEBUG_x(dump_eval());
2109 /* Register with debugger: */
2110 if (perldb && saveop->op_type == OP_REQUIRE) {
2111 CV *cv = perl_get_cv("DB::postponed", FALSE);
2115 XPUSHs((SV*)compiling.cop_filegv);
2117 perl_call_sv((SV*)cv, G_DISCARD);
2121 /* compiled okay, so do it */
2123 CvDEPTH(compcv) = 1;
2125 SP = stack_base + POPMARK; /* pop original mark */
2126 RETURNOP(eval_start);
2132 register CONTEXT *cx;
2137 I32 gimme = G_SCALAR;
2138 PerlIO *tryrsfp = 0;
2141 if (SvNIOKp(sv) && !SvPOKp(sv)) {
2142 SET_NUMERIC_STANDARD();
2143 if (atof(patchlevel) + 0.00000999 < SvNV(sv))
2144 DIE("Perl %s required--this is only version %s, stopped",
2145 SvPV(sv,na),patchlevel);
2148 name = SvPV(sv, na);
2150 DIE("Null filename used");
2151 TAINT_PROPER("require");
2152 if (op->op_type == OP_REQUIRE &&
2153 (svp = hv_fetch(GvHVn(incgv), name, SvCUR(sv), 0)) &&
2157 /* prepare to compile file */
2159 tmpname = savepv(name);
2160 if (*tmpname == '/' ||
2162 (tmpname[1] == '/' ||
2163 (tmpname[1] == '.' && tmpname[2] == '/')))
2165 || (tmpname[0] && tmpname[1] == ':')
2168 || (strchr(tmpname,':') || ((*tmpname == '[' || *tmpname == '<') &&
2169 (isALNUM(tmpname[1]) || strchr("$-_]>",tmpname[1]))))
2173 tryrsfp = PerlIO_open(tmpname,"r");
2176 AV *ar = GvAVn(incgv);
2179 char unixified[256];
2180 if (tounixspec_ts(tmpname,unixified) != NULL)
2181 for (i = 0; i <= AvFILL(ar); i++) {
2182 if (tounixpath_ts(SvPVx(*av_fetch(ar, i, TRUE), na),buf) == NULL)
2184 strcat(buf,unixified);
2186 for (i = 0; i <= AvFILL(ar); i++) {
2187 (void)sprintf(buf, "%s/%s",
2188 SvPVx(*av_fetch(ar, i, TRUE), na), name);
2190 tryrsfp = PerlIO_open(buf, "r");
2194 if (*s == '.' && s[1] == '/')
2197 tmpname = savepv(s);
2202 SAVESPTR(compiling.cop_filegv);
2203 compiling.cop_filegv = gv_fetchfile(tmpname);
2207 if (op->op_type == OP_REQUIRE) {
2208 sprintf(tokenbuf,"Can't locate %s in @INC", name);
2209 if (instr(tokenbuf,".h "))
2210 strcat(tokenbuf," (change .h to .ph maybe?)");
2211 if (instr(tokenbuf,".ph "))
2212 strcat(tokenbuf," (did you run h2ph?)");
2219 /* Assume success here to prevent recursive requirement. */
2220 (void)hv_store(GvHVn(incgv), name, strlen(name),
2221 newSVsv(GvSV(compiling.cop_filegv)), 0 );
2225 lex_start(sv_2mortal(newSVpv("",0)));
2227 save_aptr(&rsfp_filters);
2228 rsfp_filters = NULL;
2232 name = savepv(name);
2237 /* switch to eval mode */
2239 push_return(op->op_next);
2240 PUSHBLOCK(cx, CXt_EVAL, SP);
2241 PUSHEVAL(cx, name, compiling.cop_filegv);
2243 compiling.cop_line = 0;
2246 return DOCATCH(doeval(G_SCALAR));
2251 return pp_require(ARGS);
2257 register CONTEXT *cx;
2259 I32 gimme = GIMME_V, was = sub_generation;
2260 char tmpbuf[32], *safestr;
2264 if (!SvPV(sv,len) || !len)
2266 TAINT_PROPER("eval");
2272 /* switch to eval mode */
2274 SAVESPTR(compiling.cop_filegv);
2275 sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++evalseq);
2276 compiling.cop_filegv = gv_fetchfile(tmpbuf+2);
2277 compiling.cop_line = 1;
2278 /* XXX For C<eval "...">s within BEGIN {} blocks, this ends up
2279 deleting the eval's FILEGV from the stash before gv_check() runs
2280 (i.e. before run-time proper). To work around the coredump that
2281 ensues, we always turn GvMULTI_on for any globals that were
2282 introduced within evals. See force_ident(). GSAR 96-10-12 */
2283 safestr = savepv(tmpbuf);
2284 SAVEDELETE(defstash, safestr, strlen(safestr));
2286 hints = op->op_targ;
2288 push_return(op->op_next);
2289 PUSHBLOCK(cx, CXt_EVAL, SP);
2290 PUSHEVAL(cx, 0, compiling.cop_filegv);
2292 /* prepare to compile string */
2294 if (perldb && curstash != debstash)
2295 save_lines(GvAV(compiling.cop_filegv), linestr);
2297 ret = doeval(gimme);
2298 if (perldb && was != sub_generation) { /* Some subs defined here. */
2299 strcpy(safestr, "_<(eval )"); /* Anything fake and short. */
2301 return DOCATCH(ret);
2311 register CONTEXT *cx;
2313 U8 save_flags = op -> op_flags;
2318 retop = pop_return();
2320 if (gimme == G_VOID)
2322 else if (gimme == G_SCALAR) {
2325 if (SvFLAGS(TOPs) & SVs_TEMP)
2328 *MARK = sv_mortalcopy(TOPs);
2336 for (mark = newsp + 1; mark <= SP; mark++)
2337 if (!(SvFLAGS(*mark) & SVs_TEMP))
2338 *mark = sv_mortalcopy(*mark);
2339 /* in case LEAVE wipes old return values */
2341 curpm = newpm; /* Don't pop $1 et al till now */
2344 assert(CvDEPTH(compcv) == 1);
2346 CvDEPTH(compcv) = 0;
2348 if (optype == OP_REQUIRE &&
2349 !(gimme == G_SCALAR ? SvTRUE(*sp) : sp > newsp))
2351 /* Unassume the success we assumed earlier. */
2352 char *name = cx->blk_eval.old_name;
2353 (void)hv_delete(GvHVn(incgv), name, strlen(name), G_DISCARD);
2354 retop = die("%s did not return a true value", name);
2360 if (!(save_flags & OPf_SPECIAL))
2361 sv_setpv(GvSV(errgv),"");
2369 register CONTEXT *cx;
2370 I32 gimme = GIMME_V;
2375 push_return(cLOGOP->op_other->op_next);
2376 PUSHBLOCK(cx, CXt_EVAL, SP);
2378 eval_root = op; /* Only needed so that goto works right. */
2381 sv_setpv(GvSV(errgv),"");
2383 return DOCATCH(op->op_next);
2393 register CONTEXT *cx;
2400 if (gimme == G_VOID)
2402 else if (gimme == G_SCALAR) {
2405 if (SvFLAGS(TOPs) & (SVs_PADTMP|SVs_TEMP))
2408 *MARK = sv_mortalcopy(TOPs);
2417 for (mark = newsp + 1; mark <= SP; mark++)
2418 if (!(SvFLAGS(*mark) & (SVs_PADTMP|SVs_TEMP)))
2419 *mark = sv_mortalcopy(*mark);
2420 /* in case LEAVE wipes old return values */
2422 curpm = newpm; /* Don't pop $1 et al till now */
2425 sv_setpv(GvSV(errgv),"");
2434 register char *s = SvPV_force(sv, len);
2435 register char *send = s + len;
2436 register char *base;
2437 register I32 skipspaces = 0;
2440 bool postspace = FALSE;
2448 croak("Null picture in formline");
2450 New(804, fops, (send - s)*3+10, U16); /* Almost certainly too long... */
2455 *fpc++ = FF_LINEMARK;
2456 noblank = repeat = FALSE;
2474 case ' ': case '\t':
2485 *fpc++ = FF_LITERAL;
2493 *fpc++ = skipspaces;
2497 *fpc++ = FF_NEWLINE;
2501 arg = fpc - linepc + 1;
2508 *fpc++ = FF_LINEMARK;
2509 noblank = repeat = FALSE;
2518 ischop = s[-1] == '^';
2524 arg = (s - base) - 1;
2526 *fpc++ = FF_LITERAL;
2535 *fpc++ = FF_LINEGLOB;
2537 else if (*s == '#' || (*s == '.' && s[1] == '#')) {
2538 arg = ischop ? 512 : 0;
2548 arg |= 256 + (s - f);
2550 *fpc++ = s - base; /* fieldsize for FETCH */
2551 *fpc++ = FF_DECIMAL;
2556 bool ismore = FALSE;
2559 while (*++s == '>') ;
2560 prespace = FF_SPACE;
2562 else if (*s == '|') {
2563 while (*++s == '|') ;
2564 prespace = FF_HALFSPACE;
2569 while (*++s == '<') ;
2572 if (*s == '.' && s[1] == '.' && s[2] == '.') {
2576 *fpc++ = s - base; /* fieldsize for FETCH */
2578 *fpc++ = ischop ? FF_CHECKCHOP : FF_CHECKNL;
2596 { /* need to jump to the next word */
2598 z = WORD_ALIGN - SvCUR(sv) % WORD_ALIGN;
2599 SvGROW(sv, SvCUR(sv) + z + arg * sizeof(U16) + 4);
2600 s = SvPVX(sv) + SvCUR(sv) + z;
2602 Copy(fops, s, arg, U16);
2604 sv_magic(sv, Nullsv, 'f', Nullch, 0);