> I have a problem concerning parameters on a form that is being submitted.
> The form has a series of values where the names are like "name1" through
> "name10".
If you make them have all the same name ( no phun intended ), you can
access them as an array:
@array = param('name');
print $array[2]; # i.e. name2
> Now I am no rocket scientist, but I cannot set up a loop to capture these
> parameter names. (See code snippet below.)
$hello2 = "good morning";
$name = 'hello';
$num = '2';
print ${ $name . $num };
We are telling Perl to interpolate $name and $num first then sent that
string back to be interpolated a second time as $hello2.
> open(results,">> $unique.txt");
> for ($numofanswers = 1; $numofanswers <= $answernumber; $numofanswers++) {
> my $local = "\'answer$numofanswers'\";
> @answers[$numofanswers] = param($local);
> }
> print results @answer;
> close $results;
$local probably isn't the best name for a variable since its also the
name of a function.
push @answers, param( ${ "answer$_" } ) for ( 1 .. $answernumber );
- Ron
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web