summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2004-01-22 00:24:51 +0000
committerDave Mitchell <davem@fdisolutions.com>2004-01-22 00:24:51 +0000
commit39a440a3c4b75def586b31dae242e1a577484c0e (patch)
treec666a1590ea54ba17907d82a5e942f4f5c1c6237 /op.c
parentadd36b05eee71712b766a468125f1a3c3d017f66 (diff)
downloadperl-39a440a3c4b75def586b31dae242e1a577484c0e.tar.gz
[perl #25147] C<use strict; print if foo> didn't give the
"Bareword not allowed" error unless warnings were enabled p4raw-id: //depot/perl@22194
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/op.c b/op.c
index d53b1307be..b902fed248 100644
--- a/op.c
+++ b/op.c
@@ -3343,12 +3343,10 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
}
}
if (first->op_type == OP_CONST) {
- if (ckWARN(WARN_BAREWORD) && (first->op_private & OPpCONST_BARE)) {
- if (first->op_private & OPpCONST_STRICT)
- no_bareword_allowed(first);
- else
+ if (first->op_private & OPpCONST_STRICT)
+ no_bareword_allowed(first);
+ else if (ckWARN(WARN_BAREWORD) && (first->op_private & OPpCONST_BARE))
Perl_warner(aTHX_ packWARN(WARN_BAREWORD), "Bareword found in conditional");
- }
if ((type == OP_AND) == (SvTRUE(((SVOP*)first)->op_sv))) {
op_free(first);
*firstp = Nullop;