I drew this up real quick while debating with my coworkers on where to go for lunch. If your coworkers are the gambling sort, they should like the program too.
use CGI ':standard';
print header, start_html('dinner delimma disposer');
if ( param('number') > 1 ) {
print h1('Going to lunch [Step 2]'),p , "Where do you want to go?",sta
+rt_form('Post',url());
for (1 .. param(number)) { print textfield("R","restaurant $_ ",50
+,50),br; }
print hidden('hide',param(number)),submit(),endform;
}
elsif ( param('R') ) {
@places = param('R');
@respond = ("That was an easy choice!","Why was that so difficult?","W
+hat a no-brainer!!!!","Duhhh!");
@choose = ("I'd go to","I choose","Let's go to","It's been forever sin
+ce I've had","I know we ate there last week, but I love",
"I want some man food at","You're driving to");
print h1($respond[rand @respond].' ' .$choose[rand @choose].' '.$plac
+es[rand @places].'!');
}
else {
print h1('Going to lunch [Step 1]'), p , "How many people want to go?"
+,start_form('Post',url()),
popup_menu('number', ['1','2','3','4','5','6','7','8'], '4'),submit(),
+endform;
}
print end_html;