in reply to perl syntax help for ternary operator

You can use a regex match in the ternary operator, too:
$string =~ /^level[123]$/ ? "$string stage" : 'Edit'
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ