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

    thank you Karl, could you say me, how can i show the result in a text file, please?

      See Redirection and Input and Output.

      Update:...and don't forget to show the solution you figured out... this is always of interest...

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      The web search engines are your friends ;-)

      (($_="Mzz ojjdloobnf jt uvy5502383")=~y~b-zg2-5c96-81~a-z0-9~s)=~s~~~s; print