in reply to making random number
I put in my two cents:
#!/usr/bin/perl use strict; use warnings; open( URANDOM, "</dev/urandom" ) || die $!; read( URANDOM, $_, 4 ); close URANDOM; srand( unpack( "L", $_ ) ); my $x = 91_200_000_000; my $y = 100_000_000; print map { $x + int( rand($y) ) . qq(\n) } 1 .. 1000; __END__ 91268590986 91212775408 91220942039 91291708260 91205208740 91217762181 91242983060 91202706729 91288735095 ...
See also open, read, close, srand, map (mentioned already above by davido), unpack as well as TMTOWTDI and /dev/random
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: making random number
by Anonymous Monk on Aug 25, 2014 at 09:09 UTC | |
by karlgoethebier (Abbot) on Aug 25, 2014 at 09:47 UTC | |
by spadacciniweb (Curate) on Aug 25, 2014 at 09:28 UTC |