my $hostname_ref = $dbh->selectcol_arrayref("SELECT hostname FROM perm +_inventory ORDER BY hostname"); #### use CGI; my $array_ref=[ 'eenie','meenie', 'miney', 'mo' ]; my $cgi = new CGI; print $cgi->popup_menu(-name=>'my_popup',-values=>$array_ref); #### #### #!/usr/bin/perl -w use strict; use DBI; use CGI; my $dbh = DBI->connect('DBI:Pg:funkymonkey;host=some.host.com', 'user','password') or die $DBI::errstr; my $array_ref = $dbh->selectall_arrayref(qq( select * from person order by surname ) ) or die $dbh->errstr; my $cgi = new CGI; print $cgi->dropdown_menu(-name=>'myselect', -values=>$array_ref); #### #### : use Data::Dumper : rest of our code print Dumper($array_ref); #### $VAR1 = [ [ 'Berghold' ], [ 'Bach' ], [ 'Bailey' ], [ 'Battistoni' ], [ 'Battistoni' ], [ 'Becker' ], [ 'Belfer' ], [ 'Bennett' ], --- etc --- #### | stuff left out... | handwaving... print $cgi->popup_menu(-name=>'my_popup',-values=>[ map { $_ -> [0] } @$array_ref ]); | |