in reply to Need clean code
$x = defined $var ? 50 : 40; [download]
I'm sure you meant 'defined' instead of 'undef'