Tie::Hash::Random - Generates random for different fetched keys
use Tie::Hash::Random; my %hash; tie %hash, 'Tie::Hash::Random'; my $a_random_number = $hash{foo}; my $an_other_random_number = $hash{bar}; $a_random_number == $hash{foo}; ## True ## Set a seed tie %hash, 'Tie::Hash::Random', { set=> 'alpha', min=>5, max=>5 }};
Tie::Hash::Random generates a random number each time a different key is fetched.
The actual random data is generated using Data::Random rand_chars function. The default arguments are ( set => 'all', min => 5, max => 8 ) which can be modifed using tie parameters as shown in the SYNOPSIS.
Stores data
Fetchs
Matias Alejo Garcia <matiu@cpan.org>
The latest version of this module will always be available from from CPAN at http://search.cpan.org/~ematiu.
Copyright (C) 2009, Matias Alejo Garcia
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl(1), perltie(1), Tie::StdHash(1), Tie::Hash::Cannabinol, Data::Random
To install Tie::Hash::Random, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::Hash::Random
CPAN shell
perl -MCPAN -e shell install Tie::Hash::Random
For more information on module installation, please visit the detailed CPAN module installation guide.