in reply to Scrolling list and data
Firstly, from perldoc CGI:
1. The first and second arguments are the list name (-name) and value +s (-values). As in the popup menu, the second argument should be an +array reference.
So you need to pass your array as a reference. Something like the following should do the trick:
print scrolling_list('name', \@array);
Secondly, you need to remove that line of code from your while loop, because as it stands at the moment you are printing a new list for every file. In fact, you don't even need the while loop. You could simply do something like the following (untested)...
my $data_dir = '/foo'; opendir(DIR, $data_dir) or die "Cannot opendir $data_dir:$!"; my @files = grep { /data$/ && -f "$data_dir/$_" } readdir DIR; closedir DIR; print scrolling_list('name', \@files);
Cheers,
Darren :)
|
|---|