Re: Script printing its own source code

2005-05-31 Thread Andy_Bach
> ... called quines ... And, in perl, one of the most amazing quine programs is Damian Conway's SelfGol. It's also the game of Life and a quine-izer for other programs - don't even think about looking at it. http://libarynth.f0.am/cgi-bin/twiki/view/Libarynth/SelfGOL I had the good fortune to s

RE: Script printing its own source code

2005-05-31 Thread Anderson, Mark (Service Delivery)
m > Sent: Tuesday, May 31, 2005 1:58 PM > To: '[EMAIL PROTECTED]'; Perl Mailing List > Subject: RE: Script printing its own source code > > *** WARNING : This message originates from the Internet *** > > > > 1) H. . . Did you chomp? > > 2) I don

RE: Script printing its own source code

2005-05-31 Thread Gardner, Sam
Title: RE: Script printing its own source code 1) H. . . Did you chomp? 2) I don't think there's any problem at all with a script opening itself as a text file.  Keep in mind that when it's running it's been interpreted and is in memory (so no file sharing issue). 

Re: Script printing its own source code

2005-05-28 Thread David Vergin
Ted Schuerzinger wrote: > Over on rec.puzzles on Usenet (<[EMAIL PROTECTED]>), somebody posted > a puzzle asking about using programming languages to print out a program's > own source code. This is a classic programming challenge called "self-replicating program" or "quine". (Try Googling ei

RE: Script printing its own source code

2005-05-28 Thread Steven Manross
ay 28, 2005 3:23 PM To: Perl-Win32-Users@listserv.ActiveState.com Subject: Re: Script printing its own source code That's just the Windows command prompt putting in a line before returning to the prompt. If u did it in Bash u could get it to not do that. But for the puzzle they were proba

Re: Script printing its own source code

2005-05-28 Thread Chris Wagner
That's just the Windows command prompt putting in a line before returning to the prompt. If u did it in Bash u could get it to not do that. But for the puzzle they were probably talking about making a script that printed itself without knowing it's own name ahead of time. -- REMEMBER THE WOR

Script printing its own source code

2005-05-28 Thread Ted Schuerzinger
Over on rec.puzzles on Usenet (<[EMAIL PROTECTED]>), somebody posted a puzzle asking about using programming languages to print out a program's own source code. So, I quickly whipped up the following 11-line script in Perl: #! perl -w use strict; my $selfprint="c:/scripts/selfprint.pl";