Data::Randr - numeral randomizer for a cache expires time
use Data::Randr qw/randr/; randr(10); # 9 - 11 randr(10, 20); # 8 - 12 randr(10, 20, 4); # 8.0000 - 11.9999 down to 4 decimal places, ex. 8.4321
or OOP style
use Data::Randr; my $rdr = Data::Randr->new(rate => 20, digit => 2); $rdr->randr(10); # 8.00 - 11.99
Data::Randr gives random number for a cache expires time to avoid the thundering herd problem.
constructor
randomize rate(1 - 100)
decimal number
response randomized number
Like below, $res is 8.0000 - 11.9999.
$res
my $res = randr( 10, # base number 20, # randomize rate for base number 4, # decimal number );
Data::Randr is hosted on github: http://github.com/bayashi/Data-Randr
I appreciate any feedback :D
Dai Okabayashi <bayashi@cpan.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Data::Randr, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Randr
CPAN shell
perl -MCPAN -e shell install Data::Randr
For more information on module installation, please visit the detailed CPAN module installation guide.