http://www.perlmonks.org?node_id=11126207


in reply to is rand random enough to simulate dice rolls?

But the case is I want to put this inside a .t file of a module

If this is for distribution to CPAN, then personally I would try and stay away from anything random - there are lots of different systems out there, and why risk literally random test failures? Instead, I'd ask what it is you're actually testing, because I personally wouldn't see the need for testing that Perl's rand is working correctly, that's the job of the Perl test suite. If you're testing that your code works properly given various inputs, then you can test that by mocking rand - or even write your code so that your PRNG is wrapped in a function, so if you've got a user who wants different sources of randomness, they can switch it out.