I certainly did find out he was right. In his paper, he gives some unsatisfying examples and suddenly I had to know more...
Thus, I ended up at
The Quine Page
Why is this in the maximum font size you ask? Well, that's because you haven't clicked on it yet. I'll wait now while you do that...
Ok. Hi. Welcome back. Now that you've browsed through at least a few quines, you have a general idea of how they work. I'd say the easiest one to understand is
This quine has simply hexidecimalized its source and it prints it out. That's all fine and dandy until you get toAuthor: Travis Emmit $s="7072696e742724733d22272e24732e225c223b5c6e222e7061636b22482a222c24 +733b0a"; print'$s="'.$s."\";\n".pack"H*",$s;
In his attempt to get it to work, it looks like it automatically turned in obfuscation. As you know, our very own camel code makes four camels out one harmless looking camel. This is not exactly a quine, but a quine may also do impressive stuff with its output. The general method to use is 'initially store the program in a string for later printing' (after you use that same code). It even looks like an eval or two may come in handy for these jokers.Author: Allan M. Due #!/usr/local/bin/perl -w use strict; $_ = q(s|(.*)|print "#!/usr/local/bin/perl -w\nuse strict;\n\$_ = q(",$1,");\n",$1,";\n"|e); s|(.*)|print "#!/usr/local/bin/perl -w\nuse strict;\n\$_ = q(",$1,");\n",$1,";\n"|e;
Believe it or not, quines, which seem to have a chicken-egg relationship, are useful in the making of compilers since the compiler needs to read sequences of the code it was written in. The C compiler was written in C (refer to Thompson Presentation). Thompson elaborates by describing how bugs could be written into compilers to create potentially untraceable hacks for security breachs (the topic of his presentation).
That said, I hope I've captured your interest. Perl seems to be a premiere language for developing quines (along with those cool PostScript examples). Feel free to include some cool links or examples of quines below. Oh, and for Petruchio, I include the obligatory link to the JavaScript quine page.