in reply to DB Question
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 ).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>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DB Question
by kshay (Beadle) on Nov 11, 2002 at 15:32 UTC | |
|
Re: Re: DB Question
by lisaw (Beadle) on Nov 11, 2002 at 16:47 UTC |