Home : Products : DBMan : Customization :

Products: DBMan: Customization: Re: [Watts] Select field from external text file: Edit Log

Here is the list of edits for this post
Re: [Watts] Select field from external text file
Code:
|;
open(SELECT,"pteam.txt") || die "Can't open file";
@pteam_list = (<SELECT> );
close (SELECT);
print qq|<select name="PTeam">|;
print qq| <option>$rec{'PTeam'}</option>|;
foreach (@pteam_list) {
chomp $_;
print "$_\n";
}
print qq|</select>

I don't see how that code can work at all. Surely:

print "$_\n";

...needs to be...

print "<option>$_\n";

You could get rid of the foreach loop altogether and do:

print map { "<option>$_" } @pteam_list;

...even better would be a while loop.

Last edited by:

RedRum: Feb 20, 2002, 8:08 AM

Edit Log: