From: Gurusamy Sarathy Date: Fri, 11 Jun 1999 16:51:04 +0000 (+0000) Subject: truncate() has a peculiar exemption from strict barewords, even X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb53490d97a5ed51902bcf0779766b7e3359f9ff;p=p5sagit%2Fp5-mst-13.2.git truncate() has a peculiar exemption from strict barewords, even though it has a non-filehandle prototype p4raw-id: //depot/perl@3533 --- diff --git a/op.c b/op.c index 5097156..8257d7d 100644 --- a/op.c +++ b/op.c @@ -5534,9 +5534,12 @@ Perl_ck_trunc(pTHX_ OP *o) if (kid->op_type == OP_NULL) kid = (SVOP*)kid->op_sibling; - if (kid && - kid->op_type == OP_CONST && (kid->op_private & OPpCONST_BARE)) + if (kid && kid->op_type == OP_CONST && + (kid->op_private & OPpCONST_BARE)) + { o->op_flags |= OPf_SPECIAL; + kid->op_private &= ~OPpCONST_STRICT; + } } return ck_fun(o); } diff --git a/t/io/fs.t b/t/io/fs.t index b92ef8e..b74c9ca 100755 --- a/t/io/fs.t +++ b/t/io/fs.t @@ -142,8 +142,11 @@ else { if (-z "Iofs.tmp") {print "ok 24\n"} else {print "not ok 24\n"} open(FH, ">Iofs.tmp") or die "Can't create Iofs.tmp"; { select FH; $| = 1; select STDOUT } - print FH "helloworld\n"; - truncate FH, 5; + { + use strict; + print FH "helloworld\n"; + truncate FH, 5; + } if ($^O eq 'dos') { close (FH); open (FH, ">>Iofs.tmp") or die "Can't reopen Iofs.tmp"; }