But this IS documented behavior, see srand
Yes, Rolf, agreed. I know that if you initialize
srand with a specific number, you'll be able to get repeatedly the same sequence from
rand if you run it several times on the same machine with the same Perl version. This is not specific to perl, many programming languages have the same feature. And this is useful especially for some testing purposes (e.g. to be able to test the same conditions several times).
But I said: "you should probably not try to rely on a random number generator to give you always the same sequence of numbers." The word always is important in what I meant. One should not expect the same sequence forever.
And the possible solution I suggested relies on that: if you need the same sequence of pseudo-random integers with different Perl versions and platforms, for whatever reason,, then store that sequence somewhere and re-use it.