in reply to This is why Perl is so frustrating
Assume that $file eq '.'
| (($file ne ".") or ($file ne "..")) |
| (('.' ne ".") or ('.' ne "..")) |
| ((FALSE) or (TRUE)) |
$file eq '..' is left as an exercise for the reader.
In general, if you have ((X <> A) || (X <> B)) (unless you have a dualstate quantum variable of some sort), you will end up with (TRUE || FALSE), (FALSE || TRUE), or (TRUE || TRUE), all of which reduce to TRUE.
Update: You may also want to see -X to test if a directory entry is actually a file that you can open.
|
|---|