Help required in accessing hash references.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

 Using DBI Perl Programming I get a database o/p as
 Student             SubjectCode        Marks
 A                       Ma                90
 A                       Sc                89
 B                       Ma                70
 B                       Sc                71
 B                       Ge                71
 C                       Sc                73
 C                       Ge                97
 ...                    ...                ...
 Subject code may vary to any value.
 I need a report o/p in the following format and
 displayed in HTML
 Student            Ma  Sc  Ge .....
 A                  90  89
 B                  70  71  71
 C                      73  97

  # chuck all the data into an array
    my $students;
    while (my $row = $sth->fetchrow_hashref) {
    $students->}->} = $row->;

    foreach $student(sort keys %$students) {
    print $student, "\t";
    foreach  $subject(sort keys %}) {
        print "\t", $students->->;
    print "\n";

The subject field would vary
But this doesnt seem to work.I also need to put the values in an matrix.

Could anyone pls help me out in this.


Site Timeline