use strict; use warnings; use Math::Random::Secure 'irand'; # Random number between 0 and 1 inclusive (total 524288-1 numbers). sub custom_rand { irand(524288) / 524287; } printf("%f\n", custom_rand()) for 1 .. 20;