in reply to Re: (Ovid - design your programs) Re(3): hash/array
in thread hash/array
Then you want to search the first column of that array for the desired rowid, and print it out in an html table.$ary[0][0]='marge'; $ary[0][1]='phychology'; $ary[0][2]='math'; $ary[1][0]='roy'; # etc...
Hope that helps in some kind of way, I'm not sure what else you want.my $rowid = $q->param('rowid'); # get the value from our CGI.pm objec +t # search the first column for the rowid, and store the first match in +$row_ref my ($row_ref) = grep { $_->[0] eq $rowid } @ary; # output an html table containing column head labels and a row of data print '<table>', '<tr><td>rowid</td><td>course1</td><td>course2</td></tr>', '<tr>', (map {"<td>$_</td>"} @$row_ref), '</tr>', '</table>';
|
|---|