in reply to Re: Using Data::Dumper with a HoH
in thread Using Data::Dumper with a HoH

Good call.

I was first thinking of another pitfall you have to watch out for, at least with strict off, and that is when while populating the hash, some entries may not be a ref or undef, but a string. In that case, Perl will go weird on you. For example:

use Data::Dumper; no strict; %hash = ( a => 'x123' ); $hash{a}{b} = 'data'; print Dumper \%hash;
which produces:
$VAR1 = { 'a' => 'x123' };
So, where did your data go to? It went into the global variable %x123, via a symbolic reference ${$hash{$a}}{b}.
print Dumper \%hash, \%x123;
produces
Name "main::x123" used only once: possible typo at Z:\test.pl line 6. $VAR1 = { 'a' => 'x123' }; $VAR2 = { 'b' => 'data' };
The "used only once" warning is a compile time warning, but using the symbolic reference (once) doesn't produce any warnings at all.