Here's how ternary operators can be chained. (And yes, wrapping this up in a subroutine is a very good idea, but the operator chain itself could be in-lined.)
c:\@Work\Perl>perl -wMstrict -le
"my $s = qq{a ${ \str('tilt2') } operation needs @{[ str('x') ]} help}
+;
print qq{'$s'};
;;
sub str {
my ($s) = @_;
;;
return
$s eq 'level3' ? 'level3 stage' :
$s eq 'tilt2' ? 'tilt2 snafu' :
! defined $s ? 'undefined' :
qq{Edit '$s'}
;
}
"
'a tilt2 snafu operation needs Edit 'x' help'
See
Conditional Operator in
perlop.