in reply to DB Question

I'm not clear about your question -- where are things getting added to the flat data file? And what do you mean by "sent to the next line"?

That said, here's a cleanup of the code you posted:
open FILE, "$catdir/categories.dat" or error_message( "Can't find data file: $catdir/categories.dat" ); @list = <FILE>; close FILE; chomp @list; #remove newlines print "<select size=\"1\" name=\"catlisting\>\n"; foreach my $element ( sort @list ) { print "<option value=\"$element\">$element</option>\n"; } print "</select>";
I replaced the loop with a more natural foreach loop, removed the duplicate "close" statement, and removed the mystery split statement ( which does nothing, based on your data file provided ).

Replies are listed 'Best First'.
Re: Re: DB Question
by kshay (Beadle) on Nov 11, 2002 at 15:32 UTC
    You also replaced the incorrect single quotes in the HTML tags with the correct double quotes, which was going to be my suggestion...

    --Kevin

Re: Re: DB Question
by lisaw (Beadle) on Nov 11, 2002 at 16:47 UTC
    Thank you very much!! That did the trick!