for (sort sort_by_intf keys %ifSpeed) { printf "intf: %s, speed: %d\n" $_, $ifSpeed{$_}; }