I have a $map{k1}{k2}{k3}{k4}
.
How can I write the loop correctly to print all values? The following does not work.
for my $k1 (sort keys %tripletsCountMap) {
for my $k2 (sort keys %$tripletsCountMap{k1}){
for my $k3 (sort keys %$tripletsCountMap{k1}{k2}) {
for my $k4 (sort keys %$tripletsCountMap{k1}{k3}{k3}){
print "$k1 $k2 $k3 $k4\n";
}
}
}
}