in reply to Find odd/even elements of array
Then, $studentInfo[$x][0] contains the ID and $studentIfno[$x][1] the name. If the IDs are uniqe, you may profit from Perl's hashes, so build your structure in a different way:push @studentInfo, [@row];
In this case, $studentInfo{$id} contains the name (and should be renamed to %id_to_name or similar).my %studentInfo; while (my @row = $sth_queryID->fetchrow){ $studentInfo{$row[0]} = $row[1]; }
|
|---|