in reply to TK Problem (me again)
Mmmh, I don't want to spoil the fun of discovering what's wrong or not in your loop, but once I fixed that, I ran into another serious problem: Each Tk listbox entry does not have any attribute -foreground (or any other attribute for that matter, except of course its value).
Now, I might be wrong, but if you can't make each line in a different color from the Listbox widget, maybe you'll want to look at Tk::Text, to insert a Text widget in each entry (I really don't know if it's possible though...)
UPDATE: After having checked my @INC to see what kind of modules were provided with Tk, and there's one, Tk::Textlist, which does exactly what you want: display a list box with individual properties available for each entries!
<kbd>--
|
|---|