Can anyone tell me what is wrong with this. I have been working on this for hours. I have posted the majority of the script here. It is pretty simple but I'm having a hard time with the array in the return_html sub function. Please help.
#!/usr/local/bin/perl -w #BurgerDog CGI script/HTML use CGI qw(:standard); #\\Declares global varibles and global arrays # $here = param("location"); $name = param("name"); $email = param("email"); $cost = 0; @food = ('', 'plain dog', 'cheese dog', 'big dog'); @fries = ('', 'yes', 'no'); @onionrings = ('', 'no', 'yes'); @drink = ('', 'pepsi', 'coke'); # #\\Start of the HTML page # print header(), start_html("BurgerDog Resturant"), h1("BurgerDog Order + Form"); if (param()) { return_html(); dborder(); cost(); mailout(); }else{ first_page(); } sub first_page #\\Sets up the default html page with blank fields. { print hr(); print start_form(); print p("Location: ", textfield("location")); print p("Name: ", textfield("name")); print p("Email: ", textfield("email")); print p("What type of BurgerDog would you like? ", popup_menu('foo +d', \@food)); print p("Would you like fries with that? ", popup_menu('Fries', \@ +fries)); print p("Would you like Onion Rings? ", popup_menu('OnionRings', \ +@onionrings)); print p("Would you like a drink? ", popup_menu('drink', \@drink)); print p(submit("Submit Order"), reset("Clear Order")); print end_form(), print hr(); } sub return_html #\\Returns a static html page with variable&arr +ay information. { print hr(), start_html(); print p("$name, you placed an order from $here.\n"); print p("And you would like a $food[$index].\n"); print p("$fries, french fries?\n"); print p("$onionrings, onion rings?\n"); print p("A $drink would be nice with that, Thanks!"); print p("Your total is \$$cost\n"); print p("You can be contacted at $email."); print hr(), end_html(); }
Bobby L. Curtis System Administrator

In reply to Array problem by curtisb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.