My friend Will can never decide where to go for dinner.
So out of frustration, I threw this together one night
so we could spend less than 4-5 hours discussing where
we were going for food!
Anyhow, our other friends are using it now, and I have
a quickly growing list of requested features from them.
#!/usr/bin/perl -w
#the whole purpose of this now-constantly evolving script to
#handle my friend's inabilities to pick a restaurant
#suggestions for further improvements are always welcome.
%cuisines =(
'chinese' => ['hunan', 'general joes', 'feng ling', 'chinese cafe'
+],
'italian' => ['napoli', 'star pizza', 'crostini'],
'eclectic' => ['hobbit cafe','baba yega', 'brasil'],
'mediterranean' => ["niko niko\'s",'cafe lili', 'cedars'],
'american' => ['outback', "guggenheim\'s", 'goode company bbq',
'cheesecake factory'],<br>
'texmex' => ['mission burrito','berryhill', 'canyon cafe']);
print "Hi, who is this?\n:";
chomp($name = <STDIN>);
#will went in and adding the srand part...and a lot of
#white space for some reason....
if ($name =~ /^will\b/i)
{
print "Okay, Time to choose where to go for dinner.\n";
print "The following will provide a random restaurant name to go t
+o.\n";
print "Pick one of the following: \n";
print "Chinese, Italian, Eclectic, Mediterranean, American, or Tex
+Mex.\n";
chomp($c_choice = <STDIN>);
$c_choice =~ tr/[A-Z]/[a-z]/;
srand;
print $cuisines{$c_choice}->[int(rand @{$cuisines{$c_choice}})],
"\n";
#the extra stdin is to keep the script window open under windo
+ws98. sigh.
<STDIN>;
}
else{
print "You are not Will! Go away!\n";
}
In reply to Food!
by bratling
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.