# This is a quine. $c = "# This is a quine. "; $t = q(-c$c = "-c"; $t = q(-t); # Note the repeated text here. This appears both in data # and in source. Anything you want can go here as long # as it repeats and you do not interfere with these actions... # Substitute the variables back into the data. If you do # not like symbolic refs, you could use a hash instead, same # diff. This substitution builds source out of data. $t =~ s/-(\w+)/${$1}/g; # Since data is now source, just print it and we are done. print $t; ); # Note the repeated text here. This appears both in data # and in source. Anything you want can go here as long # as it repeats and you do these actions... # Substitute the variables back into the data. If you do # not like symbolic refs, you could use a hash instead, same # diff. This substitution builds source out of data. $t =~ s/-(\w+)/${$1}/g; # Since data is now source, just print it and we are done. print $t;