Self Reproducing Perl                                                  

Can you write a perl script that reproduces itself?  Such a script,
when run, should print out an exact copy of it's own source code.  It 
should so do without actually reading the original source code file.

For example, such a program might begin as follows:

     #!/usr/bin/perl

     print "#!/usr/bin/perl\n";
     print "\n";

     etc...


Before looking at my solution, try doing this yourself.

go back