in reply to Hashes - sorting keys
Your code for sorting is fine, but you don't sort all hashkeys but just those picked in your first loop. To sort all of them you can use, as davorg already said:
Your second loop looks similar to the first one. Again you compare the randomly ordered hashkeys with the numbers stored in an array (@temps).my @temps = sort { $a <=> $b } keys %hash;
This won't get you very far. If you need all the values of your hash, you can get them, again as davorg stated
BTW: If you deal with numbers and want to compare them, you should use == instead of eq. Simply because 0.0 == 0 but "0.0" ne "0"@fluors= @hash{@temps};
|
|---|