# this gives $result as 1, not 33. Makes sense,
# since $val == 4 evaluates to 1. But, I want $result to
# be assigned 33, based on the fact that $val == 4.
$result = ($major_length == 4800) ? 18
: ($major_length == 8552)
? ($val == 4) : 33;
####
if ($major_length == 4800) {
$result = 18;
} elsif ($major_length == 8552) {
if ($val == 4) {
$result = 33;
} else {
# $result is Unspecified (see A below)
}
} else {
# $result is Unspecified (see B below)
}
####
$result = ($major_length == 4800)? 18:
(($major_length == 8552)?
(($val == 4)? 33:
undef): # see A above
undef); # see B above