I didn't state whether I needed "uniform" random numbers, or just shake it up a little. But it wouldn't be long until I encountered Mr. Drum's concerns in other applications, especially something like cryptography.

If the $rand routine is uniform, Mr. Argv0's solution will be skewed. Otherwise, both are skewed and you might need to implement your own.

MSL only has one data structure, hash tables, just like PHP. But according to the docs, entries can be accessed with integer indices, therefore a random item can be used and removed.

I tinkered around with hash tables a bit; I haven't used them much. I'm having problems accessing the data associated with an item, but the script is successful this far.
Code:
alias test {
  if (!$hget(testhash)) hmake testhash
  var %k 5
  while (%k) {
    hadd -s testhash item $+ %k data $+ %k
    dec %k
  }
  echo -s size: $hget(testhash, 0).item
  while ($hget(testhash, 0).item) {
    var %r $rand(1, $hget(testhash, 0).item)
    var %i $hget(testhash, %r).item
    var %d %hget(testhash, %r).data
    var %d2 %hget(testhash, %r)
    var %d3 %hget(testhash, %i).data
    var %d4 %hget(testhash, %i)
    echo -s r %r i %i d %d %d2 %d3 %d4
    hdel testhash %i
  }
  echo -s testhash
  hfree testhash
}

The expected output is:
Code:
size: 5
r 4 i item3 d data3
r 4 i item1 d data1
r 3 i item2 d data2
r 1 i item4 d data4
r 1 i item5 d data5
testhash

But the observed output is:
Code:
size: 5
r 4 i item3 d
r 4 i item1 d
r 3 i item2 d
r 1 i item4 d
r 1 i item5 d
testhash

Any ideas?