# Kludge to get options sorted. package MySortHash; use Tie::Hash; use vars qw(@ISA); @ISA = qw( Tie::StdHash ); sub FIRSTKEY { my $self = shift; @{ $self->{VERY_UNLIKELY_HASH_KEY} } = sort {$self->{$a} cmp $self->{$b} } grep { $_ ne 'VERY_UNLIKELY_HASH_KEY' } keys %{$self}; return shift @{ $self->{VERY_UNLIKELY_HASH_KEY} }; } sub NEXTKEY { my $self = shift; return shift @{ $self->{VERY_UNLIKELY_HASH_KEY} }; } # later in package main... tie %thash, 'MySortHash' ; # tied hash with sorted keys... print $q->popup_menu(-name=>$p , labels=> \%thash, -values=> [ (keys %thash) ] );