Docker::Names::Random - Create random strings like Docker does for container names.
version 0.0.2
# As an object (if you create many, this is more efficient). require Docker::Names::Random; my $dnr = Docker::Names::Random->new(); my $random_name1 = $dnr->docker_name(); # As an imported function. use Docker::Names::Random qw( docker_name ); # OR use Docker::Names::Random qw( :all ); my $random_name2 = docker_name();
If you are using Docker, you may have noticed that it creates random names for containers when you haven't provided any specific name. These names are a combination of an adjective and a proper name of an individual. The individuals are famous men and women picked from the history of scientific exploration and engineering.
This package allows you to use the same system in your own programs. You would get combinations like interesting_mendeleev, epic_engelbart, lucid_dhawan, recursing_cori, ecstatic_liskov and busy_ardinghelli.
The combination boring_wozniak is not allowed because Steve Wozniak is not boring. This same limitation exists in the original code.
This module is currently being developed so changes in the API are possible, though unlikely.
Create object.
require Docker::Names::Random; my $dnr = Docker::Names::Random->new();
Return a random string.
my $random_name = $dnr->docker_name();
use Docker::Names::Random qw( docker_name ); # OR use Docker::Names::Random qw( :all ); my $random_name = docker_name();
Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
This software is copyright (c) 2020 by Mikko Johannes Koivunalho.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Docker::Names::Random, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Docker::Names::Random
CPAN shell
perl -MCPAN -e shell install Docker::Names::Random
For more information on module installation, please visit the detailed CPAN module installation guide.