note
ikegami
<blockquote><p><i>If we removed just subroutine prototypes rom the language the proof would not hold any more. So the question is is there a more general proof that does not rely on prototypes?</i></blockquote>
<p>Yes:
<c>
BEGIN {
eval "sub foo {}" if rand() < 0.5;
}
foo 'x';
</c>
<c>
>perl -c test.pl
test.pl syntax OK
>perl -c test.pl
String found where operator expected at test.pl line 5, near "foo 'x'"
(Do you need to predeclare foo?)
syntax error at test.pl line 5, near "foo 'x'"
test.pl had compilation errors.
</c>
<p>Execution is required to decide whether <c>foo</c> is a subroutine call or a bareword.
790624
790665