my $n = 3; my $s = $n == 1 ? 'one' : $n == 2 ? 'two' : $n == 3 ? 'three' : $n == 4 ? 'four' : 'ETOOBIG'; print "$n : $s\n"; # 3 : three