From: Gurusamy Sarathy Date: Mon, 24 Apr 2000 04:56:08 +0000 (+0000) Subject: caller() wasn't returning the right number of elements for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=811a4de936cdd31b057f2952efd5352bfccbaef0;p=p5sagit%2Fp5-mst-13.2.git caller() wasn't returning the right number of elements for eval {...} p4raw-id: //depot/perl@5914 --- diff --git a/pp_ctl.c b/pp_ctl.c index acbcc7e..7a2eb20 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1521,15 +1521,21 @@ PP(pp_caller) else PUSHs(sv_2mortal(newSViv(gimme & G_ARRAY))); if (CxTYPE(cx) == CXt_EVAL) { + /* eval STRING */ if (cx->blk_eval.old_op_type == OP_ENTEREVAL) { PUSHs(cx->blk_eval.cur_text); PUSHs(&PL_sv_no); } - /* try blocks have old_namesv == 0 */ + /* require */ else if (cx->blk_eval.old_namesv) { PUSHs(sv_2mortal(newSVsv(cx->blk_eval.old_namesv))); PUSHs(&PL_sv_yes); } + /* eval BLOCK (try blocks have old_namesv == 0) */ + else { + PUSHs(&PL_sv_undef); + PUSHs(&PL_sv_undef); + } } else { PUSHs(&PL_sv_undef); diff --git a/t/pragma/warn/9enabled b/t/pragma/warn/9enabled index 7facf99..55642ff 100755 --- a/t/pragma/warn/9enabled +++ b/t/pragma/warn/9enabled @@ -332,7 +332,7 @@ print $@ ; EXPECT Usage: warnings::warn([category,] 'message') at - line 4 unknown warnings category 'fred' at - line 6 - require 0 called at - line 6 + eval {...} called at - line 6 ######## --FILE-- abc.pm