Well, the latter needs to be
print Dumper($hitsdb{$var}); but to be honest, I'm baffled by your actual problem since
Data::Dumper is generally used
because it will (usually) correctly print even deeply nested structures. I have yet to see a case where it didn't..