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.