in reply to CGI script help

I see you are doing this the hard way and that you are fond of reinventing wheels.

CGI is a module that takes care of all the GET-ing and POST-ing of parameters and can make and read all your forms and their elements. It is definitely something worth looking into.

Now for your question, I see a few possible solutions:

  1. You loop your script rather than using it once only. Every time you summarize the previous order(s) and you allow the user to add a new order. Only when he pushes the "I'm done ordering!" button, you go to the final screen.
  2. You use AJAX and dynamically add lines to your webpage for ordering more pizzas. Modules such as CGI::Ajax, HTML::AjaxTags, JQuery or OpenThought (it has a restaurant demo, which you might find inspiring) or ... can make this easy. For more info on AJAX go here.

And of course, add use strict; and use warnings; to all your code.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: CGI script help
by Anonymous Monk on May 12, 2008 at 08:21 UTC
    Looks like a homework constraint
      Well the .edu in http://nova.umuc.edu/~cm375a20/order_pizza.html is a dead giveaway, isn't?

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James