in reply to Sort never returns data in right order

++ to hippo and dave_the_m for spotting the mistake.

For your information, perl would have warned with use warnings (unless there was a "b" key somewhere in the hash):

Use of uninitialized value in numeric comparison (<=>)
That's because if $interface_bytes{"b"} is empty, perl will return undef for the missing value, and the comparison operators (<=> and cmp) will warn when one of the values is undef