Data-Random reviews

RSS | Module Info

Data-Random (0.05) *****

I needed to take n random elements from a set, and I didn't feel like writing much code. I ran 'apropos Random' on my machine, and it spat out Data::Random, something that must have been installed as a prerequisite for something else.

I checked out the manpage, and cut and pasted a single line of code and I was done. The API is very nice and offers ways to generate random words, dates, times, characters, sets and selections.

For instance, just for fun, if you want to select next week's winning Lotto numbers, something like:

print for rand_set(set => [1..50], size => 6);

will print them out for you (adjust the values to respect your local specifications). If you win, I'll settle for a 2% cut.

Data-Random (0.05) *****

I haven't looked under the hood, but it (Data::Random::WordList) did what I needed, so I didn't have to write the code.