From: Gurusamy Sarathy <gsar@cpan.org>
Date: Wed, 5 Aug 1998 00:46:53 +0000 (+0000)
Subject: end pod processing when source file is closed (prevents it carrying
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a9ae47ac2dbde43455079cf404946a27c7b4906;p=p5sagit%2Fp5-mst-13.2.git

end pod processing when source file is closed (prevents it carrying
over into require()d files)

p4raw-id: //depot/maint-5.005/perl@1730
---

diff --git a/t/comp/require.t b/t/comp/require.t
index 819c777..203b996 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -7,17 +7,27 @@ BEGIN {
 
 # don't make this lexical
 $i = 1;
-print "1..3\n";
+print "1..4\n";
 
 sub do_require {
     %INC = ();
-    open(REQ,">bleah.pm") or die "Can't write 'bleah.pm': $!";
-    print REQ @_;
-    close REQ;
+    write_file('bleah.pm',@_);
     eval { require "bleah.pm" };
     my @a; # magic guard for scope violations (must be first lexical in file)
 }
 
+sub write_file {
+    my $f = shift;
+    open(REQ,">$f") or die "Can't write '$f': $!";
+    print REQ @_;
+    close REQ;
+}
+
+# interaction with pod (see the eof)
+write_file('bleah.pm', "print 'ok $i\n'; 1;\n");
+require "bleah.pm";
+$i++;
+
 # run-time failure in require
 do_require "0;\n";
 print "# $@\nnot " unless $@ =~ /did not return a true/;
@@ -33,4 +43,8 @@ do_require "1";
 print "# $@\nnot " if $@;
 print "ok ",$i++,"\n";
 
-unlink 'bleah.pm';
+END { unlink 'bleah.pm'; }
+
+# ***interaction with pod (don't put any thing after here)***
+
+=pod
diff --git a/toke.c b/toke.c
index b5315fa..c069978 100644
--- a/toke.c
+++ b/toke.c
@@ -1822,6 +1822,7 @@ yylex(void)
 		    else
 			(void)PerlIO_close(PL_rsfp);
 		    PL_rsfp = Nullfp;
+		    PL_doextract = FALSE;
 		}
 		if (!PL_in_eval && (PL_minus_n || PL_minus_p)) {
 		    sv_setpv(PL_linestr,PL_minus_p ? ";}continue{print" : "");