in reply to how to get table data in cgi after submitting the form?

In your form CGI:

print $cgi->textfield( -name => "foo", #This is the name we need later -value => "bar" );

In your code where you want to retrieve those values:

my $foo = $cgi->param( -name => "foo" #Back from earlier );

Couldn't get easier than that :)

~Thomas~

Replies are listed 'Best First'.
Re^2: how to get table data in cgi after submitting the form?
by TJPride (Pilgrim) on Apr 07, 2012 at 11:14 UTC
    Don't know what you're initializing CGI.pm with (I always use CGI qw(:standard) ), but in my scripts I can access the form fields just by saying param('foo'), or if I want to cycle through them, param($_) for param() . Your method seems a bit wordy.
      Your method seems a bit wordy.

      I do it for verbosity, so that the OP gets exactly what I mean. You're right -- I could have done it using the :standard method, but I personally dislike that method.
      My initialisation of the CGI object is just $cgi = new CGI;

      ~Thomas~