Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: getting the right stuff

by eg (Friar)
on Feb 07, 2001 at 05:14 UTC ( [id://56868]=note: print w/replies, xml ) Need Help??


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
    that's giving me an empty bulleted list. i'm still playing around with it, but i'm not getting anything yet.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://56868]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found