From: Rick Delaney Date: Sat, 7 Jul 2007 23:06:11 +0000 (-0400) Subject: Re: [perl #43545] 'no warnings' effects $@. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=500960a6f90e95877f90eef273215f16726946b1;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #43545] 'no warnings' effects $@. Message-ID: <20070708030611.GJ436@bort.ca> p4raw-id: //depot/perl@31587 --- diff --git a/t/op/eval.t b/t/op/eval.t index 57e39dd..2eb9b1e 100755 --- a/t/op/eval.t +++ b/t/op/eval.t @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..94\n"; +print "1..95\n"; eval 'print "ok 1\n";'; @@ -455,7 +455,14 @@ print "ok $test - eval and last\n"; $test++; local $@ = "foo"; eval undef; print "not " unless $@ eq ""; - print "ok $test # eval unef \n"; $test++; + print "ok $test # eval undef \n"; $test++; +} + +{ + no warnings; + eval "/ /a;"; + print "not " unless $@ =~ /^syntax error/; + print "ok $test # eval syntax error, no warnings \n"; $test++; } diff --git a/toke.c b/toke.c index e84e18c..ead6806 100644 --- a/toke.c +++ b/toke.c @@ -12540,8 +12540,10 @@ Perl_yyerror(pTHX_ const char *s) (int)PL_multi_open,(int)PL_multi_close,(IV)PL_multi_start); PL_multi_end = 0; } - if (PL_in_eval & EVAL_WARNONLY && ckWARN_d(WARN_SYNTAX)) - Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "%"SVf, SVfARG(msg)); + if (PL_in_eval & EVAL_WARNONLY) { + if (ckWARN_d(WARN_SYNTAX)) + Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "%"SVf, SVfARG(msg)); + } else qerror(msg); if (PL_error_count >= 10) {