Sort keys in a hash
$hash{fruit} = apple; $hash{sandwich} = hamburger; $hash{drink} = bubbly; foreach $key (sort keys %hash) { print "$key => $hash{$key}\n"; }