Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Is this really random?

by 2teez (Priest)
on Nov 22, 2012 at 03:37 UTC ( #1005048=note: print w/ replies, xml ) Need Help??


in reply to Is this really random?

++ muba
.. And in addition to that, i will say also look at srand and some CPAN modules like:
Math::TrulyRandom,
Math::Random::MT::Perl,
Math::Random::Secure

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Is this really random?
Replies are listed 'Best First'.
Re^2: Is this really random?
by karlgoethebier (Vicar) on Nov 22, 2012 at 18:30 UTC

    ...what about using this?

    #!/usr/bin/perl use strict; use warnings; open(RANDOM, "<", "/dev/random") || die $!; read(RANDOM, $_, 4); close RANDOM; my $seed = unpack("L", $_); print $seed . qq(\n); srand($seed); # do stuff...

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005048]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-07-28 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls