in reply to use of uninitialized values

Perl has a function named undef, which either undefines a value (as in undef @bar), or returns an undefined value ($foo = undef). To check for definedness, you use the function defined:
if(not defined($coord_{$key1}{$key2}[2])) {  $coord_{$key1}{$key2}[2] = 0; }
or more simply
$coord_{$key1}{$key2}[2] = 0 unless defined $coord_{$key1}{$key2}[2];
or even better
$coord_{$key1}{$key2}[2] ||= 0;
Update:I forgot to say that undef is the 'uninitialized value' - an undefined (not only false but with no value).

-nuffin
zz zZ Z Z #!perl