This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[win32] merge another maintpatch to toke.c
authorHugo van der Sanden <hv@crypt.org>
Sat, 22 Nov 1997 14:45:23 +0000 (14:45 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Tue, 3 Mar 1998 02:57:33 +0000 (02:57 +0000)
Message-Id: <199711221445.OAA14153@crypt.compulink.co.uk>
Subject: Re: [PERL] Here-doc in s///e (was: Bug)

p4raw-id: //depot/win32/perl@629

t/base/lex.t
toke.c

index 6d03b9e..31bb056 100755 (executable)
@@ -2,7 +2,7 @@
 
 # $RCSfile: lex.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:04 $
 
-print "1..27\n";
+print "1..28\n";
 
 $x = 'x';
 
@@ -105,3 +105,9 @@ print "ABC" =~ /^$ary[$A]$/ ? "ok 25\n" : "not ok 25\n";
 print "FOOZ" =~ /^$foo[$A-Z]$/ ? "ok 26\n" : "not ok 26\n";
 
 print (((q{{\{\(}} . q{{\)\}}}) eq '{{\(}{\)}}') ? "ok 27\n" : "not ok 27\n");
+
+$foo = "not ok 28\n";
+$foo =~ s/^not /substr(<<EOF, 0, 0)/e;
+  Ignored
+EOF
+print $foo;
diff --git a/toke.c b/toke.c
index 3f90f74..4fee674 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1356,7 +1356,6 @@ filter_read(int idx, SV *buf_sv, int maxlen)
     return (*funcp)(idx, buf_sv, maxlen);
 }
 
-
 static char *
 filter_gets(register SV *sv, register PerlIO *fp, STRLEN append)
 {
@@ -4998,7 +4997,7 @@ scan_heredoc(register char *s)
     register char *d;
     register char *e;
     char *peek;
-    int outer = (rsfp && !lex_inwhat);
+    int outer = (rsfp && !(lex_inwhat == OP_SCALAR));
 
     s += 2;
     d = tokenbuf;