in reply to Popup Question
This prints:use CGI; use strict; my $query = CGI->new; my %users; while (<DATA>) { chomp; my ($user,$path)=( split '\|',$_ )[0,2]; warn "DB Error: $user already exists!" if exists $users{ $user }; $users{ $user } = $path; } print $query->popup_menu(-name => 'directory', -values => [sort keys %users], -labels => \%users); __DATA__ bob|asdf|/usr/data/bob alice|qwer|/usr/data/alice
<select name="directory"> <option value="alice">/usr/data/alice</option> <option value="bob">/usr/data/bob</option> </select>
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|