Sylense has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I'm completely new to CGI scripting and I'm running into a difficult issue. I'm passing in values via the URL (http://www.blah.com?name=mike)

I have this variable as a field...
my $name = param("name");

I also have boolean statements that will issue different sub-routines based on user input...

if(param('action') eq 'Yes') { &delete; #this will delete the value in "name" } elsif(param('action') eq "No') { &keep; #this will keep the value in "name" } else { &print_form; #this prints the initial screen }

The print_form basically asks the user "Do you want to delete 'name'?" and it has 2 submit buttons, yes and no. I can't seem to keep the value that I put in the URL for name after a button is clicked. Can anyone help? Thanks in advance!

Replies are listed 'Best First'.
Re: Keeping Values Perl CGI
by Anonymous Monk on Aug 15, 2009 at 01:17 UTC
      Anonymous Monk is pointing you in the right direction.

      You may also want to consider CGI::Application as a way to organize your code.