=over =item srand EXPR X X X =item srand Sets and returns the random number seed for the C operator. The point of the function is to "seed" the C function so that C can produce a different sequence each time you run your program. When called with a parameter, C uses that for the seed; otherwise it (semi-)randomly chooses a seed. In either case, starting with Perl 5.14, it returns the seed. To signal that your code will work I on Perls of a recent vintage: use 5.014; # so srand returns the seed If C is not called explicitly, it is called implicitly without a parameter at the first use of the C operator. However, this was not true of versions of Perl before 5.004, so if your script will run under older Perl versions, it should call C; otherwise most programs won't call C at all. But there are a few situations in recent Perls where programs are likely to want to call C. One is for generating predictable results generally for testing or debugging. There, you use C, with the same C<$seed> each time. Another case is that you may want to call C after a C to avoid child processes sharing the same seed value as the parent (and consequently each other). Do B call C (i.e., without an argument) more than once per process. The internal state of the random number generator should contain more entropy than can be provided by any seed, so calling C again actually I randomness. Most implementations of C take an integer and will silently truncate decimal numbers. This means C will usually produce the same results as C. To be safe, always pass C an integer. In versions of Perl prior to 5.004 the default seed was just the current C