
screwey
New User
Feb 22, 2007, 3:47 AM
Post #1 of 3
(3543 views)
|
Copying contents of a file into an html combobox/option field
|
Can't Post
|
|
Hi there, I am a beginner user of perl. i am having difficulty with my webpage. i wish to open a file, essentially choose one of the columns and copy it into a combo box. at the moment my solution is: my $modulefile = 'module.txt'; my @lines; my $dept; my $modcode; my $modname; my $sem; <td width="47%"><div align="right"> Department: </div></td> <td width="53%"><input type="text" name="textfield"> </td> </tr> <tr> <td><div align="right"> Module: </div></td> <td> <select name="select2" id="select2"> #open file. copy into array "@lines". close the file. open (module, $modulefile); @lines = <module>; close (module); #split file, print modname string into foreach $_(@lines) { my ($dept,$modcode,$modname,$sem) = split(/\\t/,$_); print "<option>$modname</option>"; } </select></td> any help would be greatly appreciated thanks
|