Hi,
I am encountering a very strange issue where hash keys are created by just being referenced in the condition statement of an if-statement. Dumper($hash_ref), returns the following:
$VAR1 = { 'block1' => { 'lib1' => { 'cell_1' => 1, 'cell_2' => 1, }, }, 'block2' => { 'lib1' => { 'cell_3' => 1, 'cell_4' => 1, }, }, };
After running the following code where $block="block3" & $libName = "lib1" :
if(!defined $hash_ref->{$block}->{$libName}) { print "This is a test\n"; }
Dumper($hash_ref), returns the following:
$VAR1 = { 'block1' => { 'lib1' => { 'cell_1' => 1, 'cell_2' => 1, }, }, 'block2' => { 'lib1' => { 'cell_3' => 1, 'cell_4' => 1, }, }, 'block3' => {}, };
Any ideas why this is happening. The same script used to work ok, but it suddently stopped working. I have tried different perl installations but the issue persists!
In reply to Strange Hash related bug, keys are created by themselves! by mak007
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |