This makes ./perl -wle 'print 12 if "abc" =~ /^(?p{"a"})b/' work again. (Previously optimizer thought that the string to match should start with "b"). Enjoy, Ilya --- ./t/op/pat.t~ Wed Jan 5 15:50:52 2000 +++ ./t/op/pat.t Fri Mar 10 16:23:07 2000 @@ -4,7 +4,7 @@ # the format supported by op/regexp.t. If you want to add a test # that does fit that format, add it to op/re_tests, not here. -print "1..195\n"; +print "1..196\n"; BEGIN { chdir 't' if -d 't'; @@ -366,6 +366,10 @@ $test++; @ans = matchit; print "# ans='@ans'\n# expect='$expect'\nnot " if "@ans" ne $expect; +print "ok $test\n"; +$test++; + +print "not " unless "abc" =~ /^(?p{"a"})b/; print "ok $test\n"; $test++; --- ./regcomp.c~ Tue Feb 1 15:29:47 2000 +++ ./regcomp.c Fri Mar 10 16:34:19 2000 @@ -1226,7 +1226,7 @@ S_study_chunk(pTHX_ regnode **scanp, I32 if (data) data->flags |= SF_HAS_EVAL; } - else if (OP(scan) == LOGICAL && scan->flags == 2) { /* Embedded */ + else if (OP(scan) == LOGICAL && scan->flags == 2) { /* Embedded follows */ if (flags & SCF_DO_SUBSTR) { scan_commit(data); data->longest = &(data->longest_float); @@ -1234,6 +1234,7 @@ S_study_chunk(pTHX_ regnode **scanp, I32 is_inf = is_inf_internal = 1; if (flags & SCF_DO_STCLASS_OR) /* Allow everything */ cl_anything(data->start_class); + flags &= ~SCF_DO_STCLASS; } /* Else: zero-length, ignore. */ scan = regnext(scan);Thread Next