<rick@consumercontact.com>)
p4raw-id: //depot/perl@5620
if (CxREALEVAL(cx))
saweval = i;
break;
+ case OP_DOFILE:
case OP_REQUIRE:
- /* require must have its own scope */
+ /* require/do must have their own scope */
return 0;
}
break;
av_store(comppadlist, 1, (SV*)PL_comppad);
CvPADLIST(PL_compcv) = comppadlist;
- if (!saveop || saveop->op_type != OP_REQUIRE)
+ if (!saveop ||
+ (saveop->op_type != OP_REQUIRE && saveop->op_type != OP_DOFILE))
+ {
CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc(caller);
+ }
SAVEFREESV(PL_compcv);
# don't make this lexical
$i = 1;
-print "1..19\n";
+print "1..20\n";
sub do_require {
%INC = ();
print "# $@\nnot " if $@;
print "ok ",$i++,"\n";
-END { 1 while unlink 'bleah.pm'; }
+# do FILE shouldn't see any outside lexicals
+my $x = "ok $i\n";
+write_file("bleah.do", <<EOT);
+\$x = "not ok $i\\n";
+EOT
+do "bleah.do";
+dofile();
+sub dofile { do "bleah.do"; };
+print $x;
+$i++;
+
+END { 1 while unlink 'bleah.pm'; 1 while unlink 'bleah.do'; }
# ***interaction with pod (don't put any thing after here)***