This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Treat a consecutive semicolons in a prototype as 1
[perl5.git] / toke.c
diff --git a/toke.c b/toke.c
index 5ad89f1..0a16715 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3995,13 +3995,13 @@ S_intuit_method(pTHX_ char *start, GV *gv, CV *cv)
     if (gv && SvTYPE(gv) == SVt_PVGV && GvIO(gv))
            return 0;
     if (cv && SvPOK(cv)) {
-               const char *proto = CvPROTO(cv);
-               if (proto) {
-                   if (*proto == ';')
-                       proto++;
-                   if (*proto == '*')
-                       return 0;
-               }
+       const char *proto = CvPROTO(cv);
+       if (proto) {
+           while (*proto && (isSPACE(*proto) || *proto == ';'))
+               proto++;
+           if (*proto == '*')
+               return 0;
+       }
     }
 
     if (*start == '$') {