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