summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-04-24 17:16:54 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-04-24 17:16:54 +0000
commitf0a6fc868045c83877fa78e3e0f6f0be236d2a27 (patch)
tree44f03413b20c59f1db854fe8f73beb33b09bc870 /pp_ctl.c
parent412d7f2ac8b8d226b5ba373178f4ce457f246032 (diff)
downloadperl-f0a6fc868045c83877fa78e3e0f6f0be236d2a27.tar.gz
propagate lexical warnings from surrounding scope correctly
within string eval() p4raw-id: //depot/perl@5934
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index d2e795f7ea..4fcfb57f4a 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3261,9 +3261,11 @@ PP(pp_entereval)
SAVEHINTS();
PL_hints = PL_op->op_targ;
SAVESPTR(PL_compiling.cop_warnings);
- if (!specialWARN(PL_compiling.cop_warnings)) {
- PL_compiling.cop_warnings = newSVsv(PL_compiling.cop_warnings) ;
- SAVEFREESV(PL_compiling.cop_warnings) ;
+ if (specialWARN(PL_curcop->cop_warnings))
+ PL_compiling.cop_warnings = PL_curcop->cop_warnings;
+ else {
+ PL_compiling.cop_warnings = newSVsv(PL_curcop->cop_warnings);
+ SAVEFREESV(PL_compiling.cop_warnings);
}
push_return(PL_op->op_next);