Random::Military returns a fictional and fantasy military unit.
This document describes Random::Military version 1.0.
use Random::Military qw(random_military random_military_by_location);
my $squad = random_military('squad');
my $platoon = random_military('platoon');
my $company = random_military('company');
my $battallion = random_military('batallion');
my $regiment = random_military('regiment');
my $brigade = random_military('brigade');
my $division = random_military('division');
my $army = random_military('army');
my $village_military = random_military_by_location('village');
my $small_town_military = random_military_by_location('small town');
my $large_town_military = random_military_by_location('large town');
my $barony_military = random_military_by_location('barony');
my $county_military = random_military_by_location('county');
my $duchy_military = random_military_by_location('duchy');
my $grand_duchy_military = random_military_by_location('grand duchy');
my $kingdom_military = random_military_by_location('kingdom');
The functions of Random::Military will return a hash with the statistics of the selected military unit. The larger the military, the larger and deeper the hash will be. random_military
and random_military_by_location
must be imported into your script.
The hash for each unit and any subunits will include the leader of the unit, the amount of each subordinate type, and the total amount of soldiers in the unit. To see the full unit, use your favorite data dumping module.
random_military('<your option>');
random_military('squad');
The squad
option returns a unit of 2 to 8 soldiers with a corporal as the leader.
random_military('platoon');
The platoon
option returns a unit of 2 to 6 squads with a sergeant as the leader.
random_military('company');
The company
option returns a unit of 2 to 4 platoons with a lieutenant as the leader.
random_military('batallion');
The batallion
option returns a unit of 2 to 4 companies with a captain as the leader.
random_military('regiment');
The regiment
option returns a unit of 2 to 4 batallions with a major as the leader.
random_military('brigade');
The brigade
option returns a unit of 2 to 4 regiments with a colonel as the leader.
random_military('division');
The division
option returns a unit of 2 to 4 brigades with a general as the leader.
random_military('army');
The army
option returns a unit of 2 to 4 divisions with a king as the leader.
The following samples are provided so you can see what data will be returned to you. The data will get deeper as you generate larger miliary units.
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 4,
"totals" => { corporal => 1, soldiers => 4, total => 5 },
}
{
"unit type" => "platoon",
"unit leader" => "sergeant",
"unit" => [
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 3,
"totals" => { corporal => 1, soldiers => 3, total => 4 },
},
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 6,
"totals" => { corporal => 1, soldiers => 6, total => 7 },
},
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 5,
"totals" => { corporal => 1, soldiers => 5, total => 6 },
},
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 4,
"totals" => { corporal => 1, soldiers => 4, total => 5 },
},
{
"unit type" => "squad",
"unit leader" => "corporal",
"soldiers" => 7,
"totals" => { corporal => 1, soldiers => 7, total => 8 },
},
],
"totals" => { sergeant => 1, corporal => 5, soldiers => 25, total => 31 },
}
{
"totals" => {
soldiers => 18021,
corporal => 3591,
sergeant => 898,
lieutenant => 295,
captain => 95,
major => 32,
colonel => 10,
general => 3,
king => 1,
total => 22946,
},
}
random_military_by_location('<your option>');
random_military_by_location
was written for fun even though it mimics random_military
.
random_military_by_location('village');
The village
option returns a squad.
random_military_by_location('small town');
The small town
option returns a platoon.
random_military_by_location('large town');
The large town
option returns a company.
random_military_by_location('barony');
The barony
option returns a battalion.
random_military_by_location('county');
The county
option returns a regiment.
random_military_by_location('duchy');
The duchy
option returns a brigade.
random_military_by_location('grand duchy');
The grand duchy
option returns a division.
random_military_by_location('kingdom');
The kingdom
option returns an army.
Random::Military depends on Games::Dice and Exporter.
Lady Aleena
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
Copyright © 2020, Lady Aleena (aleena@cpan.org)
. All rights reserved.