summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-03-15 01:02:42 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-03-14 20:28:20 +0000
commit4a202259b5c58b8852cda4ec492b88e9baff32c6 (patch)
treef96b724c3eca3b938bad78bfb1426f979cd819a9
parentc5f9c75a0ab10c124cfd9ab014b49dfd4ad68196 (diff)
downloadperl-4a202259b5c58b8852cda4ec492b88e9baff32c6.tar.gz
Re: [fix] [perl #21575] Bug with print( followed by a newline
Message-ID: <20030314210242.GA1159@ratsnest.hole> (with an added test) p4raw-id: //depot/perl@18986
-rw-r--r--t/comp/parser.t11
-rw-r--r--toke.c1
2 files changed, 11 insertions, 1 deletions
diff --git a/t/comp/parser.t b/t/comp/parser.t
index ad1c5b80bd..54ad351eb1 100644
--- a/t/comp/parser.t
+++ b/t/comp/parser.t
@@ -9,7 +9,7 @@ BEGIN {
}
require "./test.pl";
-plan( tests => 20 );
+plan( tests => 21 );
eval '%@x=0;';
like( $@, qr/^Can't modify hash dereference in repeat \(x\)/, '%@x=0' );
@@ -88,3 +88,12 @@ is( $@, '', 'PL_lex_brackstack' );
${a}{ ${a}[ @{b}{
${a}{
}
+
+# Bug #21575
+# ensure that the second print statement works, by playing a bit
+# with the test output.
+my %data = ( foo => "\n" );
+print "#";
+print(
+$data{foo});
+pass();
diff --git a/toke.c b/toke.c
index 4e5a977844..1b6baaaaff 100644
--- a/toke.c
+++ b/toke.c
@@ -3088,6 +3088,7 @@ Perl_yylex(pTHX)
PL_oldbufptr = PL_oldoldbufptr; /* allow print(STDOUT 123) */
else
PL_expect = XTERM;
+ s = skipspace(s);
TOKEN('(');
case ';':
CLINE;