Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Quine generator

by mtve (Chaplain)
on Jul 16, 2007 at 08:14 UTC ( #626794=note: print w/ replies, xml ) Need Help??


in reply to Quine generator

classical one was:

open 0;print<0>


Comment on Re: Quine generator
Download Code
Re^2: Quine generator
by ambrus (Abbot) on Jul 16, 2007 at 08:30 UTC

    Classical ones are on the Quine page (which is apparently not maintained anymore).

    The shortest non-empty non-cheating one I know is (ends with two newlines)

    print<< x2,v10 print<< x2,v10

    Another that uses perl's various quoting operators to avoid having to escape stuff dynamically is (no newline)

    $a=q(;print"\$a=q($a)$a");print"\$a=q($a)$a"

    Update: see Short quines.

Re^2: Quine generator
by Anonymous Monk on Jul 16, 2007 at 19:45 UTC
    That's CHEATING!!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2015-07-04 20:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls