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);
{ bless ['A'], 'Foo' for 1..10 }
{ bless ['B'], 'Foo' for 1..10 }
EXPECT
-
+########
+# pp_ctl.c
+use warnings;
+eval 'print $foo';
+EXPECT
+Use of uninitialized value in print at (eval 1) line 1.
+########
+# pp_ctl.c
+use warnings;
+{
+ no warnings;
+ eval 'print $foo';
+}
+EXPECT