This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove "ternary operator parsed as search pattern" warning
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index bf00793..44293de 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -8794,14 +8794,8 @@ S_scan_pat(pTHX_ char *start, I32 type)
     PERL_ARGS_ASSERT_SCAN_PAT;
 
     s = scan_str(start,TRUE,FALSE, (PL_in_eval & EVAL_RE_REPARSING), NULL);
-    if (!s) {
-       const char * const delimiter = skipspace(start);
-       Perl_croak(aTHX_
-                  (const char *)
-                  (*delimiter == '?'
-                   ? "Search pattern not terminated or ternary operator parsed as search pattern"
-                   : "Search pattern not terminated" ));
-    }
+    if (!s)
+       Perl_croak(aTHX_ "Search pattern not terminated");
 
     pm = (PMOP*)newPMOP(type, 0);
     if (PL_multi_open == '?') {