It was a mistake that this was ever allowed.
(F) A double-quoted string ended with "\c", without the required control
character name.
-=item Missing name in "my sub"
+=item Missing name in "%s sub"
(F) The reserved syntax for lexically scoped subroutines requires that
they have a name with which they can be found.
EXPECT
Missing name in "my sub" at - line 1.
########
+# NAME Missing name in "our sub"
+our sub;
+EXPECT
+Missing name in "our sub" at - line 1.
+########
+# NAME Missing name in "state sub"
+use 5.01;
+state sub;
+EXPECT
+Missing name in "state sub" at - line 2.
+########
# NAME Unterminated delimiter for here document
<<"foo
EXPECT
d = s;
s = SKIPSPACE2(s,tmpwhite);
#else
+ d = s;
s = skipspace(s);
#endif
#endif
}
else {
- if (key == KEY_my)
- Perl_croak(aTHX_ "Missing name in \"my sub\"");
+ if (key == KEY_my || key == KEY_our || key==KEY_state)
+ {
+ *d = '\0';
+ /* diag_listed_as: Missing name in "%s sub" */
+ Perl_croak(aTHX_
+ "Missing name in \"%s\"", PL_bufptr);
+ }
PL_expect = XTERMBLOCK;
attrful = XATTRTERM;
sv_setpvs(PL_subname,"?");