by puls · 7y ago · 0 comments
> This feature does enable a neat quine: the Perl program “Illegal division by zero at /tmp/quine.pl line 1.”, when saved in the appropriate location, outputs “Illegal division by zero at /tmp/quine.pl line 1.” The reason for this behavior is left as an exercise for the reader.
> (To be fair to Perl, when perl is run with the -w flag to enable warnings, it does helpfully inform the user that at some point in the future, the Perl developers will most likely pick gggijgziifiiffif as a new reserved word:
>> Unquoted string "gggijgziifiiffif" may clash with future reserved word at - line 1.)
$ perl -MO=Deparse -e "Illegal division by zero at /tmp/quine.pl line 1."
'division'->Illegal('zero'->by('at' / 'tmp' / 'quine' . line'->pl(1)));
-e syntax OKthe actual parse is
division->Illegal(
zero->by(
((“at” / “tmp”) / “quine”)
. line->pl(1.0)
)) Illegal::division(by::zero(at/tmp/quine . pl::line(1.)))Or should that be 0.0???
For quines, see the chapter "Air on G's String", a dialogue between Achilles and the Tortoise in Douglas Hofstadter's book GODEL,ESCHER,BACH: AN ETERNAL GOLDEN BRAID.