I would like to be to store the state of the random
number generator. I would like to specify the seed value
on the first run of the program, but then after that
I want the random number generator to pick up where it
left off. I want to store the last state of the random
number generator in a file. The next time I run the
program, I want it to read the file and put the
random number generator back into its previous state.
Is this possible in Perl? I did this in once in C
a long time ago, and now I want to do it again in perl.
The linux (or BSD 4.3) initstate() and setstate()
calls enable this capability in C.
It should work perfectly the first time! - toma
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|