in reply to accessing random count CGI parameters

I'd just probably use the "normal" procedur:
#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard *ul); print header; my $count; unless ($count = param('xxxc')) { print b("There's no count for you"); exit; } print b("We have $count input(s) as the following:"), start_ul; my %inputs; for my $i (1 .. $count) { my $field = "xxx$i"; my $value = param($field); $value = 'yes!' unless defined $value; $inputs{$field} = $value; # stored for later use print li("$i = $value"); } print end_ul; # use %inputs for whatever you like
Accessed as http://localhost/cgi-bin/input.cgi?xxxc=4&xxx1=Perl&xxx2=for&xxx3=all, output on the browser is:
We have 4 input(s) as the following: * 1 = Perl * 2 = for * 3 = all * 4 = yes!
And yes, it works for both GET and POST request methods.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!