Path: utzoo!attcan!telly!eci386!jmm From: jmm@eci386.uucp (John Macdonald) Newsgroups: comp.lang.perl Subject: Re: shortest self-reproducing Perl program Message-ID: <1990Mar22.173813.8074@eci386.uucp> Date: 22 Mar 90 17:38:13 GMT References: <1990Mar20.203516.8429@iwarp.intel.com> Reply-To: jmm@eci386.UUCP (John Macdonald) Organization: Elegant Communications Inc., Toronto, Canada Lines: 32 Rather than strain my brain, I let the computer find a short self-reproducing perl "program" (well, it is a program in the sense that its purpose in life is to be submitted to a Perl interpreter to cause it to generate output, but it has no other use). The shell script to generate the program, and the program it found, are: ---- cut here for genrepro sh script ---- : genrepro - generate a self-reproducing perl program echo junk >cur.prog echo trash >cur.out until cmp -s cur.prog cur.out do echo === not yet === cat cur.out mv cur.out cur.prog perl cur.prog 2>cur.out done mv cur.out cur.prog echo === final version === cat cur.prog ---- end of genrepro sh script ---- ---- cut here for cur.prog ---- syntax error in file cur.prog at line 1, next 2 tokens "syntax error" Execution aborted due to compilation errors. ---- end of cur.prog ---- -- Algol 60 was an improvment on most | John Macdonald of its successors - C.A.R. Hoare | jmm@eci386