Selfgol
by Damian Conway

Try:

1.	> selfgol -s

		With the -s flag, selfgol prints its own source code.


2.	> demo.pl

		From a simple program...

	> selfgol demo.pl > demo2.pl

		...selfgol generates a self-reproducing version

	> chmod u+x demo2.pl
	> demo2.pl

		The self-reproducing version still runs as before...

	> demo2.pl -s

		...but if you give it a -s flag, it self-reproduces.


3.	> selfgol baddemo.pl

		Not all programs can be made self-reproducing.
		selfgol diagnoses such cases and refuses.


4.	> selfgol -g

		selfgol also plays Conway's Game of Life.
		Normally, it seeds the board by reading its own
		source code and converting each character to 
		a space or an O, according to the character's
		ASCII code.


5.	> selfgol -g demo.pl

		...but if you give it another program, it will
		convert that source code to a game board instead.


6.	> selfgol -g -x=15 -y=15

		You can change the shape and size of the board.


7.	> selfgol -j

		Finally, it also can produce a *circulating* banner
		of "The Perl Journal".


Note:

        Although most of its functions involve some type of iterative
        activity, the source of selfgol contains no looping constructs
        of any kind: there are no for, while, until, map, grep, or goto
        statements.

        Instead (and fittingly), selfgol uses three distinct forms of
        self-reproduction to achieve all its behaviour.
