$ perl -MO=Deparse $f= grep {/f/} @array ? 1 : 2; $f = grep({/f/;} @array ? 1 : 2); #### $f= grep( /f/, @array ) ? 1 : 2; #### left terms and list operators (leftward) [...] right ?: [...] nonassoc list operators (rightward) [...] Terms and List Operators (Leftward) A TERM has the highest precedence in Perl. They include [...] any function whose arguments are parenthesized. [...] List Operators (Rightward) On the right side of a list operator, it has very low precedence, such that it controls all comma-separated expressions found there. The only operators with lower precedence are the logical operators "and", "or", and "not", which may be used to evaluate calls to list operators without the need for extra parentheses: open HANDLE, "filename" or die "Can't open: $!\n";