This has been here since commit
8472ac73d, which was merged into blead
in commit
55d729e4e15, if I understand the history correctly.
This warning is undocumented, and triggerable only by stash
manipulation.
It appears to be an internal check, similar to a ‘panic’ error, but
its wording doesn’t suggest anything of the sort.
A ‘sub foo;’ declaration doesn’t actually create the sub yet, but
simply puts -1 in the stash element. ‘sub foo($);’ puts '$' in the
stash element.
If newATTRSUB sees something there it doesn’t recognise, it unhelp-
fully carps ‘Runaway prototype’, but it is pretty random:
This is OK:
$ perl -e 'BEGIN{$::{foo}=undef} sub foo;'
But this is not:
$ perl -e 'BEGIN{$::{foo}=-1; $::{foo}=undef} sub foo;'
Runaway prototype at -e line 1.
Also, it only happens when the sub has no body, not for ‘sub foo {}’:
$ perl -e 'BEGIN{$::{foo}=56} sub foo{}'
$ perl -e 'BEGIN{$::{foo}=56} sub foo;'
Runaway prototype at -e line 1.
This warning is random, incomprehensible, and not at all helpful, so
we should just remove it.