sub qsort { return @_ if @_ < 2; my $pivot = pop; qsort(grep $_ < $pivot, @_), $pivot, qsort(grep $_ >= $pivot, @_); }