Consider the following sample code...

#!/usr/local/perl/bin/perl -w use strict; use Data::Dumper; my $var; my $hash = (); $hash = { LEV11 => { LEV21 => { VAL1 => '123', VAL2 => ['1', '2', '3'], VAL3 => '456', }, LEV22 => { VAL1 => '456', VAL2 => ['4', '5', '6'], VAL3 => '789', }, }, LEV12 => { LEV31 => { VAL1 => 'abc', VAL2 => ['a', 'b', 'c'], VAL3 => 'def', }, LEV32 => { VAL1 => 'def', VAL2 => ['d', 'e', 'f'], VAL3 => 'ghi', }, }, LEV13 => { LEV41 => { VAL1 => 'abc', VAL2 => ['a', 'b', 'c'], VAL3 => 'def', }, LEV42 => { VAL1 => 'def', VAL2 => ['d', 'e', 'f'], VAL3 => 'ghi', }, }, }; print Dumper($hash); $var = $hash->{LEV11}{LEV31}{VAL1} || $hash->{LEV12}{LEV31}{VAL1} || $hash->{LEV13}{LEV31}{VAL1}; print "VAR = $var\n"; print Dumper($hash);
[download]

Why do I end up with a hash key $hash->{LEV11}{LEV31} after the $var = ... assignment, when that key did not exist originally? I'm assuming it has something to do with the || operators.