foreach my $key1 (sort keys %myhash) { ## But now how do I traverse on key 2 based on key 1?? }