<SELECT NAME="usernum"> % unless ( $opt{'multiple'} || $opt{'disable_empty'} ) { <OPTION VALUE="">all</OPTION> % } % foreach my $usernum ( % sort { $opt{'access_user'}->{$a} cmp $opt{'access_user'}->{$b} } % keys %{ $opt{'access_user'} } % ) { <OPTION VALUE="<%$usernum%>"><% $opt{'access_user'}->{$usernum} %></OPTION> % } </SELECT> <%init> my %opt = @_; unless ( $opt{'access_user'} ) { my $sth = dbh->prepare(" SELECT usernum, username FROM access_user WHERE disabled = '' or disabled IS NULL ") or die dbh->errstr; $sth->execute or die $sth->errstr; while ( my $row = $sth->fetchrow_arrayref ) { $opt{'access_user'}->{$row->[0]} = $row->[1]; } } </%init>