If shuffle takes too long you could do this:
sub uploadPlaylist { for my $i ( 1 .. $numOfRandFiles ) { $playList{ splice @audioFiles, int rand @audioFiles, 1 } = $i; } }
In reply to Re^2: Add a fixed number of unique elements to hash
by jwkrahn
in thread Add a fixed number of unique elements to hash
by Vasek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |