in reply to DB Question
I'm not sure what your $nochop variable is for, since it doesn't seem to be utilized. Further, you're closing FILE twice, which is irregular considering the first is sufficient.foreach (sort @list) { my ($one, $nochop) = split(/\|/, $_); chomp($one); # Remove any trailing linefeeds print "<option value='$one'>$one</option>"; }
Usually, I would put a return call in the unless block because there's little point in displaying a page if there's no data to put in it.unless (open(FILE, "$catdir/categories.dat")) { error_message("Can't find data file - $catdir/categories.dat"); }
|
|---|