if ($_ < $pivot) { push(@less, $_); } if ($_ == $pivot) { push(@equal, $_); } # etc...