$ perl -le ' > $h = {a => 1, b => 2}; > print for sort keys %$h;' a b $