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


in reply to Re^6: rand() function on Windows systems (pure Perl)
in thread rand() function on Windows systems

One more thing.

Apparently, the random number seed sub is not necessary the srand operator works the same between the old and the new versions. The simplified code below is enough.

my $seed = srand( 555 ); print ppRand( ), "\n"; sub ppRand { my $max = shift || 1; $seed = ( $seed * 214013 + 2531011 ); return ( ( $seed >> 16 ) & 32767 ) / 32768 * $max; }