This is what I've been using and it seems to work well: foreach $lastname (sort { $a cmp $b } keys %names) { print "$lastname, $names{$lastname}\n"; }
I'm pretty new to Perl, though, and someone else might know a better way. Jolinar "Jerry Preston" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! > > I have a hash built in the following way: > > $names{ $ID } = $your_name; > > I want to l want to list in > > print $query->popup_menu( -name=>'Emp', > -values=> \%who, > -default=> \%who, > ); > > but in alphabetically. How do I do this? > > I have used the following: > > foreach $module ( sort { $para_wpf{$a} <=> $para_wpf{$b} } > keys %para_wpf ) { > > Thanks, > > Jerry > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]