@array_of_items = [ ... get items from database ]; print map { $array_of_items[$_ -1] } random_subset_X(scalar(@array_of_items), $count);