my $q = new CGI; # let's assume the values creating the option html of $fname # are stored in the array @fnames, and that the values 'GUEST' # and 'Select a member' have been 'push'd onto the end. for (0..$elements) { $name_menu{$_} = $q->scrolling_list(-name => "M$_", -values=>[@fnames], -default=>['Select a member'], -size=>1 ); }