sub by_date { return $hash{$a}{item_date} <=> $hash{$b}{item_date}; } for my $key (sort by_date keys %hash) { print "$hash{$key}{item_key} $hash{$key}{item_description}\n" }