ok I think I get it. It returns a value if true, else return value if false. It does not execute code if true or code if false. Is that a correct statement?
I think what you're confused about is still scope; like the if/else block in the original post, if you declare my $vxdg inside the ternary operator, it will fall out of scope before you try to access it again.