Skip to content

Instantly share code, notes, and snippets.

@dvberkel
Created July 24, 2011 10:31
Show Gist options
  • Save dvberkel/1102488 to your computer and use it in GitHub Desktop.
Save dvberkel/1102488 to your computer and use it in GitHub Desktop.
This gist is a Perl Quine
#! /usr/bin/env perl
use strict;
use warnings;
my $program = <<'EOP';
#! /usr/bin/env perl
use strict;
use warnings;
my $program = <<'EOP';
EOP
my $copy = $program;
$program =~ s/^\t//gm;
$program =~ s/(\n)(EOP)/$1$copy$2/;
print $program;
EOP
my $copy = $program;
$program =~ s/^\t//gm;
$program =~ s/(\n)(EOP)/$1$copy$2/;
print $program;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment