trueif the file is a directory and
falseotherwise. It turns out that
-Cis such a flag.
In Perl, these build-in flags take precedence over user-defined functions, so in your expression
-Cis being interpreted as a file test flag, not a minus with a function call. Personally, I think this is a bad choice, but it is the way it is, and we have to live with that.
There are a number of ways to work around it. One is to put a space between the minus and the "C"; this is why your second format works. Another would be to put parentheses around the function calls, as in
It is actually good practice to pus spaces around operators (for readability), so if you get in the habit of that, you will not run into this issue. But I understand how it can be confusing.