Hello all,


When I populate this hash (%SrcIDs) from "SELECT id, desc, from myTable order by desc" it doesn't order by the description field "desc". (printing each row in the while loop show that the SQL is sorted)

while( my($id, $desc) = $sth->fetchrow ) {
       $SrcIDs{$id} = $desc;
}
$sth->finish;

my @Sources = keys(%SrcIDs);

# Begin HTML
print header('text/html');
print start_html('Select Source Mill Info Page'),
  h3('Select Source Mill'),
  startform('GET','srcmill.cgi','','gosrcmill','_blank'),
  "Source Mill: &nbsp",
    popup_menu('millid', [EMAIL PROTECTED], '', \%SrcIDs),p,
...

So, you see I want to link @Sources with the keys of %SrcIDs, but what I want is to sort the hash alphabetically by the values of %SrcIDs. Please, how can I do that?

Cheers.

Scott.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to