From: Kay Röpke Date: Tue, 9 Jul 2002 14:12:10 +0000 (+0200) Subject: Fwd: [ID 20020703.002] bareword processing bug under 'use strict' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2bc6235c05b89ccf6657edc09a1d622eb191a37e;p=p5sagit%2Fp5-mst-13.2.git Fwd: [ID 20020703.002] bareword processing bug under 'use strict' Message-Id: <184F11EC-9335-11D6-8F80-000393414688@dolphin-services.de> p4raw-id: //depot/perl@17457 --- diff --git a/op.c b/op.c index 0a8c0a2..5a60a1c 100644 --- a/op.c +++ b/op.c @@ -3977,6 +3977,10 @@ Perl_newCONDOP(pTHX_ I32 flags, OP *first, OP *trueop, OP *falseop) scalarboolean(first); if (first->op_type == OP_CONST) { + if (first->op_private & OPpCONST_BARE && + first->op_private & OPpCONST_STRICT) { + no_bareword_allowed(first); + } if (SvTRUE(((SVOP*)first)->op_sv)) { op_free(first); op_free(falseop); diff --git a/t/lib/strict/subs b/t/lib/strict/subs index 88d4afc..4a90809 100644 --- a/t/lib/strict/subs +++ b/t/lib/strict/subs @@ -334,3 +334,14 @@ use strict; EXPECT Bareword "foo" not allowed while "strict subs" in use at - line 4. Execution of - aborted due to compilation errors. + +######## + +# ID 20020703.002 +use strict; +use warnings; +my $abc = XYZ ? 1 : 0; +print "$abc\n"; +EXPECT +Bareword "XYZ" not allowed while "strict subs" in use at - line 5. +Execution of - aborted due to compilation errors.