CityCat has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on How to write a script that prints its own source code?

Replies are listed 'Best First'.
Re: CityCat
by RMGir (Prior) on Sep 17, 2002 at 20:12 UTC
    That class of programs are called "Quines", for some reason which was unknown to me until I followed that link.

    There are some awesome ones on this site, like 3-D Stereogram, Self replicating source., quine madness, spiraling quine, and One-Line Quine for instance. Just type "Quine" in the search box, as I did, and you'll find plenty of examples.

    Note that if this is a homework assignment, I really don't recommend using solutions from here. Your teacher may already know about PerlMonks, and a lot of these solutions are pretty well known around here.
    --
    Mike

      And even if not, it is likely that the teacher will get suspicious at the proficiency of Perl skill most of these quines required to write.. (And he will likely be able to tell even without knowing Perl particularly well.)

      Makeshifts last the longest.

      Your teacher may already know about PerlMonks, and a lot of these solutions are pretty well known around here.

      Mmmm, maybe they are learning about PerlMonks :)

Re: CityCat
by hiseldl (Priest) on Sep 17, 2002 at 20:07 UTC
    use Super Search with the term 'quine,' and you should run into a few nodes that can help.

    --
    hiseldl
    "Act better than you feel"

Re: CityCat
by fglock (Vicar) on Sep 17, 2002 at 20:10 UTC
    --- begin program test.pl --- 1; ---- end program --- How to use: perl -p test.pl test.pl

      ok :)

      --- begin program test.pl --- print; ---- end program --- How to use: perl -n test.pl test.pl
    A reply falls below the community's threshold of quality. You may see it by logging in.
Quine.pm
by charnos (Friar) on Sep 17, 2002 at 22:39 UTC