Skip to content

Latest commit

 

History

History
192 lines (107 loc) · 5.01 KB

Food.pod

File metadata and controls

192 lines (107 loc) · 5.01 KB

NAME

Random::Food returns either a random food or drink.

VERSION

This document describes Random::Food version 1.000.

SYNOPSIS

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

DESCRIPTION

Random::Food returns either a random food with random_food or drink with random_drink.

Options

nothing, all, or undef

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 options

fruits

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.

tubers

random_food('tubers');

The tubers option returns potato, sweet potato, or yam.

meats

random_food('meats');

The meats option returns beef, lamb, chicken, pork, turkey, or fish.

junk foods

random_food('junk foods');

The junk foods option returns corn chips, potato chips, pretzels, or crackers.

Lucky Charms

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'};

Klondike bars

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'};

M&Ms

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 options

beers

random_drink('beers');

The beers option returns stout beer, mild beer, wheat beer, lager beer, lambic beer, or pale ale.

hot drinks

random_drink('hot drinks');

The hot drinks option returns coffee, tea, or cider.

juices

random_drink('juices');

The juices option returns apple juice, grape juice, orange juice, cranberry juice, grapefruit juice, tomato juice, or lemonade.

Kool-Aid

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'};

by keys

random_food('by keys');
random_drink('by keys');

The by keys option returns a random key listed above.

keys

random_food('keys');
random_drink('keys');

The keys option will list all of the available keys in an array reference.

data

random_food('data');
random_drink('data');

The data option will return the data used in a hash reference.

help or options

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.

Adding items to a list

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);

DEPENDENCIES

Random::Food depends on Fancy::Rand, Fancy::Map, Fancy::Open, File::ShareDir, and Exporter.

AUTHOR

Lady Aleena

LICENSE AND COPYRIGHT

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.