# A for ( sort keys %h ){ dostuffwith($_); } # B dostuffwith($_) for sort keys %h; # C dostuffwith($_) for (sort keys %h);