Here is my solution.                                                  

  #!/usr/bin/perl
  $x='#!/usr/bin/perl%c$x=%c%s%c;printf $x,10,39,$x,39,10;%c';printf $x,10,39,$x,39,10;

Can you find a way to make it smaller?


Here are some links to some self-reproducing programs in other languages:

   Eli Biham

   Markus Holzer


go back