<?xml version="1.0" encoding="windows-1252"?>
<node id="788801" title="Re^2: Perl Cannot Be Parsed: A Formal Proof" created="2009-08-14 21:53:30" updated="2009-08-14 21:53:30">
<type id="11">
note</type>
<author id="641652">
Jeffrey Kegler</author>
<data>
<field name="doctext">
&lt;p&gt;In a series of three articles in &lt;i&gt;The Perl Review&lt;/i&gt;, [href://http://www.jeffreykegler.com/Home/perl-and-undecidability|now available online], I laid this proof out much more carefully, in three different versions.  The most bullet-proof version derives the result directly from Rice's Theorem.

&lt;p&gt;You are right that the proof would not go through if the only way of establishing a prototype for a Perl function was via a function definition.  As I said in &lt;i&gt;Perl Review&lt;/i&gt; (4.3, p. 28):
                                                              &lt;blockquote&gt;I must show that I can use Turing-complete Perl code to determine the prototype of the &lt;tt&gt;dunno&lt;/tt&gt; subroutine at compile time.  A function definition won’t work.&lt;/blockquote&gt;

&lt;p&gt;Summarizing from that article, there are at least two ways that the prototype of a subroutine can be established using Turing-complete Perl code.  One is with symbol table manipulation, for example:
              
&lt;blockquote&gt;&lt;c&gt;BEGIN { *dunno = sub () { 3 } }&lt;/c&gt;&lt;/blockquote&gt;

A second way is to put the function definition into a string which is &lt;tt&gt;eval&lt;/tt&gt;'d in a BEGIN block.  I believe clever monks will be able to think of others.
</field>
<field name="root_node">
663393</field>
<field name="parent_node">
788460</field>
</data>
</node>
