in reply to Randomize List of items
Use the Schwartz, Luke!#!/usr/bin/perl -w use strict; my @oldList = (1 .. 50); my @newList = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [$_, rand] } @oldList; print "Numbers:\n", (join "-", @newList), "\n";
|
---|