In Perl, it\'s often nice to be able to assign an object, but specify some fall-back value if the variable being assigned from is \'undef\'. For instance:
my $x
first you can do your full-on with a ternary:
a = y if x is None else x
but it doesn't solve your problem. what you want to do is more closely implemented with:
try: a = x except: a = y