(!defined($key)) ? $bar : (exists($foo{$key})) ? $foo{$key} : $foo{$key} = undef;