Sure. For example a "quine" is a program that produces its own source code as output. Running that output again as a Perl program of course yields the same output again.
There are also nice multi-language quines, for example Perl code that output shell code, which then again produces the original Perl code etc. See for example http://www.nyx.net/~gthompso/quine.htm and http://johannesloetzsch.de/software/quines/.
A less obscure example is a compiler: A compiler produces working code, and if it is written in the language it compiles, then it can compile itself, and the result can again compile itself etc. This is called "bootstrapping".
Another example would be Acme::EyeDrops, which you can probably use on itself.
In reply to Re: Programs that write programs
by moritz
in thread Programs that write programs
by FelixGeator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |