[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Why are the file test operators in perlfunc?



This came up on #perl recently, why are the filetest operators in perlfunc?
They sure look like unary operators to me.  I wouldn't think to look for them
amongst the functions.

There's only one mention of them in perlop, and that's this.

       Regarding precedence, the filetest operators, like "-f", "-M", etc. are
       treated like named unary operators, but they don't follow this func-
       tional parenthesis rule.  That means, for example, that
       "-f($file).".bak"" is equivalent to "-f "$file.bak"".

Even the perlfunc entry says they're ops.

       -X FILEHANDLE
       -X EXPR
       -X      A file test, where X is one of the letters listed below.  This
               unary operator takes one argument

Would anyone be opposed to their docs being moved to perlop?


-- 
Stabbing you in the face for your own good.


Follow-Ups from:
Eirik Berg Hanssen <Eirik-Berg.Hanssen@allverden.no>
"David Nicol" <davidnicol@gmail.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]