in reply to Re: getting the right stuff
in thread getting the right stuff
print ul( map { ul("$course") } keys %data);
looks wrong. What you're doing here is printing the same $course (which contains the last course read) for every record. Also you're going to get Extremely Funky HTML (lists inside lists, without any items?) What you want is probably something like:
print "<ul>"; foreach my $ref ( @records ) { print "<li>", $ref->{Course}, "</li>"; } print "</ul>";
Do you see the difference? While $course refers to the variable that never changes in your final loop, whereas $ref->{course} refers to the data in the hash reference whose key is the string "course". This does change because $ref changes for every iteration.
Update: changes "course" to "Course" in key.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: getting the right stuff
by malaga (Pilgrim) on Feb 07, 2001 at 05:29 UTC |