Hello,

I am trying to sort a hash of hashes.

My code looks like this:

 foreach $cnt (sort keys %{ $relations{ $uid }{ "instances" } }){
           print OUT "$cnt 1, ";
}

This is returning the correct part of the hash of hashes. However it
is not being sorted correctly. All the instances keys are integers
however they are not being sorted smallest to highest. Instead they
are sorted as if the first digit was the first level qualifier.

An example is:

 100 1, 120 1, 121 1, 122 1, 123 1, 124 1, 125 1, 126 1, 127 1, 132 1,
133 1, 134 1, 135 1, 136 1, 137 1, 138 1, 139 1, 221 1, 222 1, 223 1,
224 1, 225 1, 226 1, 227 1, 228 1, 235 1, 236 1, 237 1, 238 1, 239 1,
240 1, 241 1, 242 1, 323 1, 324 1, 325 1, 326 1, 327 1, 328 1, 329 1,
330 1, 50 1, 51 1, 52 1, 53 1, 54 1, 55 1, 56 1, 57 1, 93 1, 94 1, 95
1, 96 1, 97 1, 98 1, 99 1,

Instead they should start at 50 and range to 330.

Does anyone know why this isn't working and how I can resolve the
problem


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


Reply via email to