Random::Food returns either a random food or drink.
This document describes Random::Food version 1.000.
use Random::Food qw(random_food random_drink);
my $food = random_food('all'); # returns a food from any list
my $fruit = random_food('fruits'); # returns a fruit
my $tuber = random_food('tubers'); # returns a tuber
my $meat = random_food('meats'); # returns a meat
my $junk = random_food('junk foods'); # returns a junk food
my $Lucky_Charm = random_food('Lucky Charms'); # returns a magically delicious Lucky Charm
my $Klondike_bar = random_food('Klondike bars'); # returns a Klondike bar flavor
my $MandM = random_food('M&Ms'); # returns an M&M flavor
print random_food('help'); # get random_food options
my $drink = random_drink('all'); # returns a drink from any list
my $beer = random_drink('beers'); # returns a beer or ale
my $hot = random_drink('hot drinks'); # returns a hot drink
my $juice = random_drink('juices'); # returns a juice
my $KoolAid = random_drink('Kool-Aid'); # returns a Kool-Aid flavor
print random_drink('help'); # get random_drink options
Random::Food returns either a random food with random_food
or drink with random_drink
.
random_food;
random_food();
random_food('all');
random_food(undef);
random_drink;
random_drink();
random_drink('all');
random_drink(undef);
These options will return any value in any list related to the function. You can read the options below to see all of the potential values.
random_food('fruits');
The fruits
option returns apple, apricot, banana, blueberry, cherry, cranberry, grape, grapefruit, lemon, lime, orange, peach, pear, plum, raspberry, strawberry, or tomato.
random_food('tubers');
The tubers
option returns potato, sweet potato, or yam.
random_food('meats');
The meats
option returns beef, lamb, chicken, pork, turkey, or fish.
random_food('junk foods');
The junk foods
option returns corn chips, potato chips, pretzels, or crackers.
random_food('Lucky Charms');
The Lucky Charms
option returns one of the following: heart, star, horseshoe, green clover, blue moon, hourglass, rainbow, red balloon, one of the swirled moons, one of the hats with clovers, or one of the swirled diamonds. For the complete list of Lucky Charms, you can do the following:
my $charms = random_food('data')->{'Lucky Charms'};
random_food('Klondike bars');
The Klondike bars
option returns a flavor of Klondike Bars. For the complete list of Klondike bar flavors, you can do the following:
my $Klondike = random_food('data')->{'Klondike bars'};
random_food('M&Ms');
The M&Ms
option returns a flavor of M&Ms. For the complete list of M&M flavors, you can do the following:
my $MandMs = random_food('data')->{'M&Ms'};
random_drink('beers');
The beers
option returns stout beer, mild beer, wheat beer, lager beer, lambic beer, or pale ale.
random_drink('hot drinks');
The hot drinks
option returns coffee, tea, or cider.
random_drink('juices');
The juices
option returns apple juice, grape juice, orange juice, cranberry juice, grapefruit juice, tomato juice, or lemonade.
random_drink('Kool-Aid');
The Kool-Aid
option returns a flavor of Kool-Aid. For the complete list of Kool-Aid flavors, you can do the following:
my $KoolAid = random_drink('data')->{'Kool-Aid'};
random_food('by keys');
random_drink('by keys');
The by keys
option returns a random key listed above.
random_food('keys');
random_drink('keys');
The keys
option will list all of the available keys in an array reference.
random_food('data');
random_drink('data');
The data
option will return the data used in a hash reference.
random_food('help');
random_drink('help');
random_food('options');
random_drink('options');
The help
or options
options will return a list of all of your options.
You can add items to the list by adding an array reference with the additional items as the second parameter.
my @additions = ('food 1', 'food 2');
random_food('<your option>', \@additions);
my @additions = ('drink 1', 'drink 2');
random_drink('<your option>', \@additions);
Random::Food depends on Fancy::Rand, Fancy::Map, Fancy::Open, File::ShareDir, 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.