Skip to content

Instantly share code, notes, and snippets.

@zby
Created October 6, 2012 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zby/3844302 to your computer and use it in GitHub Desktop.
Save zby/3844302 to your computer and use it in GitHub Desktop.
a simple perl quine
my $x = 'my $x = X;
$y = chr(39) . $x . chr(39);
$x =~ s/X/$y/;
print $x;
';
$y = chr(39) . $x . chr(39);
$x =~ s/X/$y/;
print $x;
@kogorman
Copy link

kogorman commented Sep 2, 2019

Here's a shorter one, also simple, or at least short. Remarkable in that it's two identical lines followed by one blank line

print <<''x2,"\n"
print <<''x2,"\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment