constant ranges could escape bareword check in list context
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 6 Jan 2000 00:22:40 +0000 (00:22 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 6 Jan 2000 00:22:40 +0000 (00:22 +0000)
p4raw-id: //depot/perl@4760

op.c
t/pragma/strict-subs

diff --git a/op.c b/op.c
index d38a387..0351b0e 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2236,6 +2236,7 @@ Perl_gen_constant_list(pTHX_ register OP *o)
 
     PL_op = curop = LINKLIST(o);
     o->op_next = 0;
+    peep(curop);
     pp_pushmark();
     CALLRUNOPS(aTHX);
     PL_op = curop;
index deeb381..ed4fe7a 100644 (file)
@@ -33,6 +33,24 @@ Execution of - aborted due to compilation errors.
 ########
 
 # strict subs - error
+use strict 'subs' ;
+my @a = (A..Z);
+EXPECT
+Bareword "Z" not allowed while "strict subs" in use at - line 4.
+Bareword "A" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
+use strict 'subs' ;
+my $a = (B..Y);
+EXPECT
+Bareword "Y" not allowed while "strict subs" in use at - line 4.
+Bareword "B" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
 use strict ;
 Fred ;
 EXPECT