concatenation binds more closely than ternary op and logical AND &&, so the ternary is looking at the result of the concatenation (which evaluates to true, see perlsyn manpage on 'Truth vs Falsehood') and not the match , whereas in the highlighted cases the match (between parens) is evaluated first. See perlop manpage on how Perl looks at a statement. <br>
<br>The say function is expecting a list, so to get what you expect you need something like:<br><br>say (( 'h e l l o' =~ /h e l l o/x )?'true':'false') <br><br>to get everything else to be evaluated and the result said<br>
<br>Otherwise I misunderstand the question... (first day back from holiday :-)<br><br><br>