in reply to retrieve dynamic form data

Assuming you're using CGI, you can use the param method to return all of the form parameters passed in. One of the nice things about param is that you can use it in list context, so you can loop through or grab the names of all params, so you can do:
my @names = CGI::param; for my $name ( @names ){ # Get each value. my $value = CGI::param($name); # Do something with the value. }

Replies are listed 'Best First'.
Re^2: retrieve dynamic form data
by Anonymous Monk on Nov 22, 2005 at 21:59 UTC
    I have tried doing this but the array always comes back empty. Any idea why?
      I don't know for sure, but the simple reason would be that no parameters are being passed to the script. You could test this, even just to rule it out, by putting a hidden field in your form with a known value or even putting some query params at the end of the 'action' line in your form tag. I wouldn't recommend doing this permanently, but it can help debug. For example, in your form, you could:
      <form action="http://my.site.com/script.pl?test1=one">
      How are you testing whether the params are coming back? Just printing back to the browser? Because it's also possible that you are getting them, but you aren't displaying them properly. Can you show some code?