http://qs321.pair.com?node_id=477359


in reply to creating CGI::scrolling_list ... can this be shortened?

Using much the same technique as described here:

my $sth = $dbh->prepare("SELECT id, display_name FROM membership ORDER + BY display_name"); $sth->execute; my %row; $sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } )); while ($sth->fetch) { my $memberWidget = $q->scrolling_list( -name => '...', -values => [ @row{sort keys %row}], -labels => \%row, ... ); push (@memberWidgets, $memberWidget); }

I'm not sure about the -values and -labels option of scrolling_list (as I've never used CGI built-ins) but this should get you started (and the keys aren't sorted but the order you get it from the database is the same).

"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce