random - have rand() return integers or fixed values
Version 0.01
use random; my $dice = 1 + rand 6; # one of 1 .. 6 # or use random qw(integer); my $dice = 1 + rand 6; # one of 1 .. 6 use random qw(fixed 6); # cheat on dice my $six = rand; # 6
Nothing.
when random (integer) is in effect it returns int(rand)
when random (fixed) is in effect it returns the fixed value
otherwise CORE::rand
Joerg Meltzer, <joerg {at} joergmeltzer.de>
<joerg {at} joergmeltzer.de>
Please report any bugs or feature requests to bug-random at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=random. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-random at rt.cpan.org
The fixed value -123456789 doesn't work. The value is reserved to make the integer option work.
You can find documentation for this module with the perldoc command.
perldoc random
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=random
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/random
CPAN Ratings
http://cpanratings.perl.org/d/random
Search CPAN
http://search.cpan.org/dist/random/
Thanx goes to Abeltje (http://yapc.tv/2008/ye/lt/lt2-02-abeltje-fixedtime). I learned about pragmas watching your show.
Copyright 2009 Joerg Meltzer, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install random, copy and paste the appropriate command in to your terminal.
cpanm
cpanm random
CPAN shell
perl -MCPAN -e shell install random
For more information on module installation, please visit the detailed CPAN module installation guide.