in reply to Passing a lot of form values

Here is what I have so far, but it doesn't like it for some reason:
#Get the row count my $sp = $dbh->prepare(" select ROWNUM FROM LAWL.HEHE_SECURITY ORDER BY ROWNUM DESC; "); $sp->execute(); my $myrowcounter = $sp->fetchrow_array; my $countrows = 1; my %incoming = &read_input; # Read information into associated # array %incoming. while ($countrows <= $myrowcounter) { my $qty[$countrows] = $incoming{'qty$countrows'}; # Fetch the text fro +m the array. my $type[$countrows] = $incoming{'type$countrows'}; # Fetch the text f +rom the array. my $equip[$countrows] = $incoming{'equip$countrows'}; # Fetch the text + from the array. my $dept[$countrows] = $incoming{'dept$countrows'}; # Fetch the text f +rom the array. my $fstore[$countrows] = $incoming{'fstore$countrows'}; # Fetch the te +xt from the array. my $dreceived[$countrows] = $incoming{'dreceived$countrows'}; # Fetch +the text from the array. my $rstore[$countrows] = $incoming{'rstor$countrowse'}; # Fetch the te +xt from the array. my $ringstore[$countrows] = $incoming{'ringstore$countrows'}; # Fetch +the text from the array. my $dated[$countrows] = $incoming{'dated$countrows'}; # Fetch the text + from the array. my $comment[$countrows] = $incoming{'comment$countrows'}; # Fetch the +text from the array. my $id[$countrows] = $incoming{'id_$countrows'}; # Fetch the text from + the array. my $action[$countrows] = $incoming{'action_$countrows'}; # Fetch the t +ext from the array. }

syntax error at massupdate.cgi line 388, near "@qty[" syntax error at massupdate.cgi line 389, near "@type[" syntax error at massupdate.cgi line 390, near "@equip[" massupdate.cgi had compilation errors.

Replies are listed 'Best First'.
Re^2: Passing a lot of form values
by carmen (Initiate) on May 23, 2007 at 21:20 UTC
    my $qty[$countrows] = $incoming{'qty$countrows'};
    ?? did you really mean to do the my within the while? Also I don't see $countrows being incremented. How about declaring the arrays outside of the while loop?
    my (@qty, @type,@equip,@dept); #etc. while ($countrows <= $myrowcounter) { $qty[$countrows] = $incoming{'qty$countrows'}; $type[$countrows] = $incoming{'type$countrows'}; $equip[$countrows] = $incoming{'equip$countrows'}; $dept[$countrows] = $incoming{'dept$countrows'}; #etc. $countrows++; }
    Not sure if there was anything else wrong but that was my 1st thought. Hope that helps. -- Carmen