Skip to content

Instantly share code, notes, and snippets.

@unixpickle
Created November 5, 2010 01:00
Show Gist options
  • Save unixpickle/663487 to your computer and use it in GitHub Desktop.
Save unixpickle/663487 to your computer and use it in GitHub Desktop.
detect weather python is better than perl
#!/usr/bin/perl
$_ = "the quick brown fox jumps over the lazy dog.";
$mstr = "python";
s/( ?)[a-z]+/\1${mstr}/g;
$i = length($_);
$_ = "the quick brown fox jumps over the lazy dog.";
$mstr = "perl";
s/( ?)[a-z]+/\1${mstr}/g;
$i1 = length($_);
unless ($i1 > $i) {
print "Python is greater or equal to perl.\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment