my $sixth = 'whatever'; $var = defined($var) ? $sixth : 3;