sub multi_thread_sort { my @list = @_; my $pivot = shift @list; my @lowList = grep { $_ < $pivot } @list; my @highList = grep { $_ >= $pivot } @list; # Now start two threads to sort the two lists concurrently. return ( @lowList, $pivot, @highList ); }