NAME
Data::Random::Flexible - Fast iflexible profilable randoms
VERSION
Version 1.00
SYNOPSIS
A more flexible set of randoms for when you want to be random FAST
use Data::Random::Flexible;
my $random = Data::Random::Flexible->new();
say "32 Character random of numbers?, sure: ".$random->int(32);
say "16 Character random of letters?, sure: ".$random->char(16);
say "16 Of a mixture of numbers and letters?, sure: ".$random->mix(16);
say "Random mixture of 16 your own characters?, sure: ".$random->profile('irc',16, [qw(a b c 1 2 3)]);
new
Create a new Math::Random::Flexible object, accepts 1 optional argument, a hashref of profiles
store
Set and/or return the stored profiles, will always return the currently used profiles, unless you pass it something it did not expect as a first argument, where it will return a blank hashref.
alpha()
Return a random alpha character uppercase or lowercase, accepts 1 argument 'length', if length is ommited return a single alpha-char;
char()
Though technically wrong, its a shorthand to alpha()
numeric()
Return a random whole number, accepts 1 argument 'length', if length is ommited return a single number.
int()
A shorthand for numeric()
alphanumeric()
Return a random alphanumeric string, accepts 1 argument 'length', if length is ommited return a single random alpha or number.
mix()
A shorthand for alphanumeric()
profile()
Set or adjust a profile of characters to be used for randoms, accepts 3 arguments in the following usages:
Create or edit a profile named some_name and return a 16 long string from it $random->profile('some_name',16,[qw(1 2 3)]);
Return 16 chars from the pre-saved profile 'some_name' $random->profile('some_name',16);
Delete a stored profile $random->profile('some_name',0,[]);
AUTHOR
Paul G Webster, <daemon at cpan.org>
BUGS
Please report any bugs to: https://github.com/PaulGWebster/p5-Data-Random-Flexible
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc p5::Data::Random::Flexible
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2017 Paul G Webster.
This program is distributed under the (Revised) BSD License: http://www.opensource.org/licenses/BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Paul G Webster's Organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.