Skip to content

Instantly share code, notes, and snippets.

@pjlsergeant
Created November 1, 2012 09:39
Show Gist options
  • Select an option

  • Save pjlsergeant/3992746 to your computer and use it in GitHub Desktop.

Select an option

Save pjlsergeant/3992746 to your computer and use it in GitHub Desktop.
Two-line quicksort using part
sub qs {
my @i = part { 1 + ($_ <=> $_[0]) } @_;
return @i ? (qs(@{$i[0]}), @{$i[1]}, qs(@{$i[2]})) : ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment