in reply to Short form (ternary) if else
Perhaps you want to declare $vxdg outside the if, and only assign the value inside the if?
my $vxdg = (exists $foo) ? $bar : 'baz';