use deref; $href = { 1,2,3,4 }; for (sort keys HASH{ $href }) { print "$_ -> $href->{$_}\n"; }