I want to creat a drop down menu from an array can anybody help, i think im on the right track but i cant get it to work. My code below.
Mad Axe
#!/Perl/bin/perl
use CGI;
$userlist = "playerlist.cgi";
print "Content-type: text/html\n\n";
open (PLAYERLIST, "$playerlist");
@userlist = <PLAYERLIST>;
close (PLAYERLIST);
<FORM ACTION='datahandling.cgi' METHOD=POST>
<SELECT NAME="TEST">
foreach $dataline (@userlist){
chomp $dataline;
($value, $description) = split(/\|/, $dataline);
<OPTION VALUE='$value'>$discription</OPTION>
}
</SELECT>
<INPUT TYPE=SUBMIT value="Tell Me">
</FORM>
ARRAY FILE playerlist.cgi
marc1|player1
marc2|player2
marc3|player3
marc4|player4
marc5|player5
marc6|player6
Mad Axe
#!/Perl/bin/perl
use CGI;
$userlist = "playerlist.cgi";
print "Content-type: text/html\n\n";
open (PLAYERLIST, "$playerlist");
@userlist = <PLAYERLIST>;
close (PLAYERLIST);
<FORM ACTION='datahandling.cgi' METHOD=POST>
<SELECT NAME="TEST">
foreach $dataline (@userlist){
chomp $dataline;
($value, $description) = split(/\|/, $dataline);
<OPTION VALUE='$value'>$discription</OPTION>
}
</SELECT>
<INPUT TYPE=SUBMIT value="Tell Me">
</FORM>
ARRAY FILE playerlist.cgi
marc1|player1
marc2|player2
marc3|player3
marc4|player4
marc5|player5
marc6|player6