C
cartercc
I have constructed a table using input from a database. It looks like
this:
<table>
<tr>
<td>Pat</td>
<td><input type="radio" name="sex1" value="M" /> Guy<br />
<td><input type="radio" name="sex1" value="F" /> Gal</td>
</tr><tr>
<td>Les</td>
<td><input type="radio" name="sex2" value="M" /> Guy<br />
<td><input type="radio" name="sex2" value="F" /> Gal</td>
</tr><tr>
<td>Sal</td>
<td><input type="radio" name="sex3" value="M" /> Guy<br />
<td><input type="radio" name="sex3" value="F" /> Gal</td>
</tr>
</table>
The table is generated from a database where there is no data in the
'gender' column. I cannot tell in advance how many rows will be
generated. I will pass the data to an update script that will write the
values to the 'gender' column. My script sends the appropriate string,
like 'page.cgi?user=me&role=manager&sex1=M&sex2=F&sex3=F'
I *could* use checkboxes and glob all the values together, like
'sex=v1M;v2F;v3F', read these into a variable, split the string, read
it into an array, and run a series of update queries (and will probably
wind up doing this for lack of something better), but I'd really like
to pass each value separately into its own variable, or better still,
to pass the whole thing as an arrayref to a series of hash refs, like
[{Pat=>'M'},{Les=>'F'},{Sal=>'F'}] ... but I don't know how to
dynamically allocate variables in a Perl script or perhaps use a client
side script to create and pass an array ref.
Ideas, anyone? I really, really would appreciate it.
CC
this:
<table>
<tr>
<td>Pat</td>
<td><input type="radio" name="sex1" value="M" /> Guy<br />
<td><input type="radio" name="sex1" value="F" /> Gal</td>
</tr><tr>
<td>Les</td>
<td><input type="radio" name="sex2" value="M" /> Guy<br />
<td><input type="radio" name="sex2" value="F" /> Gal</td>
</tr><tr>
<td>Sal</td>
<td><input type="radio" name="sex3" value="M" /> Guy<br />
<td><input type="radio" name="sex3" value="F" /> Gal</td>
</tr>
</table>
The table is generated from a database where there is no data in the
'gender' column. I cannot tell in advance how many rows will be
generated. I will pass the data to an update script that will write the
values to the 'gender' column. My script sends the appropriate string,
like 'page.cgi?user=me&role=manager&sex1=M&sex2=F&sex3=F'
I *could* use checkboxes and glob all the values together, like
'sex=v1M;v2F;v3F', read these into a variable, split the string, read
it into an array, and run a series of update queries (and will probably
wind up doing this for lack of something better), but I'd really like
to pass each value separately into its own variable, or better still,
to pass the whole thing as an arrayref to a series of hash refs, like
[{Pat=>'M'},{Les=>'F'},{Sal=>'F'}] ... but I don't know how to
dynamically allocate variables in a Perl script or perhaps use a client
side script to create and pass an array ref.
Ideas, anyone? I really, really would appreciate it.
CC