you should be calling it out of only an AUTOLOAD routine anyway. See
L<perlfunc/goto>.
+=item Can't goto subroutine from an eval-string
+
+(F) The "goto subroutine" call can't be used to jump out of an eval "string".
+(You can use it to jump out of an eval {BLOCK}, but you probably don't want to.)
+
=item Can't localize through a reference
(F) You said something like C<local $$ref>, which Perl can't currently
if (cxix < cxstack_ix)
dounwind(cxix);
TOPBLOCK(cx);
+ if (cx->cx_type == CXt_EVAL && cx->blk_eval.old_op_type == OP_ENTEREVAL)
+ DIE("Can't goto subroutine from an eval-string");
mark = stack_sp;
- if (cx->blk_sub.hasargs) { /* put @_ back onto stack */
+ if (cx->cx_type == CXt_SUB &&
+ cx->blk_sub.hasargs) { /* put @_ back onto stack */
AV* av = cx->blk_sub.argarray;
items = AvFILLp(av) + 1;
AvREAL_off(av);
av_clear(av);
}
- if (!(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth))
+ if (cx->cx_type == CXt_SUB &&
+ !(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth))
SvREFCNT_dec(cx->blk_sub.cv);
oldsave = scopestack[scopestack_ix - 1];
LEAVE_SCOPE(oldsave);
else {
AV* padlist = CvPADLIST(cv);
SV** svp = AvARRAY(padlist);
+ if (cx->cx_type == CXt_EVAL) {
+ in_eval = cx->blk_eval.old_in_eval;
+ eval_root = cx->blk_eval.old_eval_root;
+ cx->cx_type = CXt_SUB;
+ cx->blk_sub.hasargs = 0;
+ }
cx->blk_sub.cv = cv;
cx->blk_sub.olddepth = CvDEPTH(cv);
CvDEPTH(cv)++;