|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am fairly new to Perl and I have come across a problem that I cannot seem to find any help on.
I am trying to list the contents of a directory on the server in a normal HTML Drop Down Box. Does anyone have any pointers or can help? it would be much appreciated =P |
|
#2
|
|||
|
|||
|
Try This: #!/perl $dir = "/path/to/dir"; @files = `$ls $dir`; chomp @files; print "<select>"; for (@files) { print "<option value="$_">$_n"; } print "</select>"; That ought to do it. |
|
#3
|
|||
|
|||
|
That worked with a bit of modifying, cheers.
|
|
#4
|
|||
|
|||
|
Hmmm...Actually that is just listing the directory and not the contents of the directory :
|
|
#5
|
|||
|
|||
|
Start here -> http://www.devshed.com/Talk/Forums/Forum6/HTML/000335.html Then alter the "print" line with "print "<option value...". Or you may include the $target_dir within that line.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Listing Files in Drop Box |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|