Nope, letting perl set srand is good enough. And you are right about Monte Carlo needing a purer random base than a pseudo-random generator. Most Monte Carlo's use scads of randoms per cycle and you loop the psuedo random in 2**31 calls on most systems and 2**15 on some.

Look to CPAN and you will find some of what you need. First off, if you are going to write your own "random" sequence generator you my find PDL handy. If you want someone else to do the work on random numbers try Math::Random or Math::TrulyRandom but I would recommend you find an OS specific random source like Linux's /dev/random and /dev/urandom

#!/usr/bin/perl -w use strict; #use Linux; ## I wish. =) (yeah yeah, $^O, etc etc) open UR, "</dev/urandom" or die "Oh man, your system sucks, $!"; my $pages= shift()+0 || 1; die "Give me a number greater than 0 or nothing, bub.\n" unless $pages +>0; while ($pages-->0) { my $buf; read UR, $buf, 512 or die "Ouch that shouldn't happen, $!"; for (0..31) { print vec($buf,$_*4,32), "\t", vec($buf,$_*4+1,32), "\t", vec($buf,$_*4+2,32), "\t", vec($buf,$_*4+3,32), "\n"; } }

--
$you = new YOU;
honk() if $you->love(perl)


In reply to Re: Srand versus rand by extremely
in thread Pi calculator by Fingo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.