summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-08-28 02:37:41 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-08-28 02:37:41 +0000
commit9b01e405a9bb7e4ded558565e812624f7c7f28fe (patch)
treef9d2830c11c9276c971343ebf74b02f1d2962e2d /toke.c
parentb5470100d305ad04c1e682dd4b1a313c58003e2a (diff)
downloadperl-9b01e405a9bb7e4ded558565e812624f7c7f28fe.tar.gz
Re: truncate with file name does not work (with patch)
The prototype for truncate was changed so that perl won't die with C<use strict;> when the first arg is a bareword (filehandle). I think it was Tom (as in "tchrist") who brought this up. Here's a patch that undoes the damage, makes it work with C<use strict;>, and adds to the testsuite.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index ccd4aed92f..6c4b7cdd69 100644
--- a/toke.c
+++ b/toke.c
@@ -2516,6 +2516,7 @@ yylex()
if (hints & HINT_STRICT_SUBS &&
lastchar != '-' &&
strnNE(s,"->",2) &&
+ last_lop_op != OP_TRUNCATE && /* S/F prototype in opcode.pl */
last_lop_op != OP_ACCEPT &&
last_lop_op != OP_PIPE_OP &&
last_lop_op != OP_SOCKPAIR)