Thread::Rand - repeatable random sequences between threads
use Thread::Rand; # exports rand() and srand() use Thread::Rand (); # must call fully qualified subs
*** A note of CAUTION *** This module only functions on Perl versions 5.8.0 and later. And then only when threads are enabled with -Dusethreads. It is of no use with any version of Perl before 5.8.0 or without threads enabled. *************************
The Thread::Rand module allows you to create repeatable random sequences between different threads. Without it, repeatable random sequences can only be created within a thread.
There are only two subroutines.
my $value = rand(); # a value between 0 and 1 my $value = rand( number ); # a value between 0 and number-1 inclusive
The "rand" subroutine functions exactly the same as the normal rand() function.
srand( usethis );
The "srand" subroutine functions exactly the same as the normal srand() function.
Elizabeth Mattijsen, <liz@dijkmat.nl>.
Please report bugs to <perlbugs@dijkmat.nl>.
Copyright (c) 2002 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Thread::Tie.
To install Thread::Rand, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Thread::Rand
CPAN shell
perl -MCPAN -e shell install Thread::Rand
For more information on module installation, please visit the detailed CPAN module installation guide.