Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
while ((my $key, my $value) = each (%hash)) { for (my $i=0; $i< @nums; $i++) { if ($key eq $nums[$i]) { push @temps, "$key"; } } } @temps = sort {$a<=>$b} @temps; while ((my $key, my $value) = each (%hash)) { for (my $i=0; $i < @temps; $i++) { if ($key eq $temps[$i]) { push @fluors, "$value"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hashes - sorting keys
by davorg (Chancellor) on Jul 15, 2003 at 10:15 UTC | |
by Skeeve (Parson) on Jul 15, 2003 at 10:21 UTC | |
by davorg (Chancellor) on Jul 15, 2003 at 10:24 UTC | |
by Skeeve (Parson) on Jul 15, 2003 at 10:27 UTC | |
|
Re: Hashes - sorting keys
by Skeeve (Parson) on Jul 15, 2003 at 10:32 UTC |